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:
- Ages ago, VS.NET defaulted to using absolute positioning for everything. This is how VB worked from its beginning (meaning, Windows apps before the web even existed), and VS.NET was made to feel similar to VB.
- However, using absolute positioning for everything on a web page is a very bad idea. See one of the responses below for some concrete examples of why.
- Since using absolute positioning for every single control on a web app page is such a bad idea, all that advice about using "Flow layout" sprung up. It was a way of working with VS.NET without absolutely positioning everything.
- Now that CSS is so mature and widely supported, and is the preferred mechanism for positioning and appearance, it is STILL CRAZY to absolutely position everything, and for the same reasons. Most items should be allowed to position themselves "in the flow". However, for some elements here and there, absolute CSS positioning might make sense.
- The mechanism VS.NET has always used to perform absolute positioning is actually inline CSS styles.
Great to have all this cleared up. Thanks.