开发者

is it wise to use position: absolute; in asp.net?

开发者 https://www.devze.com 2023-01-28 01:30 出处:网络
i\'am new in web programing is it be wise to use position: absolute;on controls ? if n开发者_JAVA技巧o - why ?position: absolute; is a CSS attribute. It doesn\'t have anything to do with C# or Asp.N

i'am new in web programing

is it be wise to use position: absolute; on controls ?

if n开发者_JAVA技巧o - why ?


position: absolute; is a CSS attribute. It doesn't have anything to do with C# or Asp.Net itself. Whether you should use it or not is solely dependent on the design specifications of the website you're developing.


If you want absolute control where your controls display on screen (regardless of the size of the screen), then go for it.

Most people use a mix of display: absolute; and other positioning techniques to get the desired layout.

Keep in mind, though, that none of this has to do with ASP.NET (besides the fact that Visual Studio sometimes defaults to absolute positioning of elements in the WYSIWYG Editor). They key there is the same as other WYSIWYG editors...write the markup by hand.


All the controls in .net has a html markup , if you want change the postions in the markup you may need to use postion:absolute or relative

for exampe you have a ascx contorl which has divs

<div id="parentdiv">  // parent div

<div id="childidv">  // child div 
</div>

</div>

In the above scenario if you want to make childdiv always bottom of parent div , you give childdiv as absolute position and parent div as relative position

This is how positions are used in ...html markup in asp.net.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号