For years, Visual Studio.NET has offered "absolute positioning" for ASP.NET, whereby you can drag controls onto the designer canvas wherever you want them to be. However, there has always been strong advice not to use that feature. Instead, the common wisdom said you should use "Flow layout", because if you were to use VS.NET's "absolute positioning", your screen would not render correctly for users whose screen resolution was different from yours.
However, that's old advice. A while back, CSS came out with the ability to perform "absolute positioning" in a standards-compliant way, and most or all browsers caught up with CSS and have implemented CSS positioning correctly (or well enough at least).
So the current recommended practice is to position elements using CSS absolute positioning.
Question is: What is it that CSS does correctly about absolute positioning, that Visual Studio does wrongly? How can CSS absolute positioning be OK even for users who have different screen resolutions, while Visual Studio.NET cannot?
UPDATE: The responses here have cleared the matter up for me. Here's how I summarize it:
Great to have all this cleared up. Thanks.
As a general web development point absolute positioning is frowned upon. It has some rare uses but not many in a good css design.
Visual studio acheived this layout by using inline css styling, but it was still css absolute positioning.
The best way to develop a web layout is to start with the content rendered into valid HTML elements. Then look to improve the layout using CSS by applying proper cascading rules to those elements. Then add classes to individual elements which need to layout differently from the standard elements.
Lastly to add any whizz bang features you can use Javascript like Jquery to visually enhance the look and feel of standard html controls.
This way your site can "degrade gracefully" with browsers which are less capable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With