是绝对定位的最佳实践还是应该避免呢? [英] Is Absolute positioning a best practice or should I avoid it?

查看:160
本文介绍了是绝对定位的最佳实践还是应该避免呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在观看ASP.NET学习视频的 http:/ /www.asp.net/learn/3.5-videos/video-13.aspx
,它显示你可以使用绝对定位在页面上放置控件。我只是想知道这是一个最佳实践还是应该避免绝对定位?这似乎是一个很好的,容易的功能,但必须有一些原因,为什么它在默认情况下没有在VS IDE中选择。

I am watching the ASP.NET learn video on http://www.asp.net/learn/3.5-videos/video-13.aspx and it is showing you can place controls on a page using Absolute positioning. I am just wondering if this is a best practice or should I avoid Absolute positioning? It seems like a nice, easy feature, but there must be some reason why it is not selected by default in the VS IDE.

推荐答案

许多用户通过配置浏览器设置来更改页面的字体大小。

Many users change the font size of your page by configuring their browser settings. If you use absolute positioning, things will not align right for them.

在绝对定位中,当页面变得更复杂时,单个设计决策将需要重新定位所有的元素,但在相对位置,您只需要更改一个值,所有其他元素将相应地进行调整。

In absolute positioning, when your page gets more complex, a single design decision would require you to reposition all of the elements, but in relative positioning, you would only need to change one value, and all the other elements would adjust accordingly.

这篇关于是绝对定位的最佳实践还是应该避免呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆