Home arrow Style Sheets arrow Using Relative Positioning For Consistent Layout
STYLE SHEETS

Using Relative Positioning For Consistent Layout


Converting a site to Web standards can be quite a struggle. It’s difficult enough to achieve a satisfying layout with positioning, floating, and all that. But it’s downright frustrating to realize that the positioning you’ve chosen doesn’t render consistently in different resolutions, or even multiple browsers in the same resolution! Well, take heart; this article will explain why relative positioning is a trustworthy friend in this case!

Author Info:
By: Justin Cook
Rating: 4 stars4 stars4 stars4 stars4 stars / 18
June 23, 2005
TABLE OF CONTENTS:
  1. · Using Relative Positioning For Consistent Layout
  2. · Relative Positioning Explained
  3. · A Basic Web Page
  4. · Now that’s Style!

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Using Relative Positioning For Consistent Layout
(Page 1 of 4 )

Introduction

The future of Web design can more or less be summed up in two words: Web standards. If you’re not yet sure of what that means, or you’re not convinced that compliance is worth the up-front effort, then please take a look at this article before going any further: http://www.devarticles.com/c/a/HTML/W3C-Web-Standards/. If you’ve already taken the plunge into table-less page layout and design, then no doubt you’re experiencing no small amount of frustration! No worries, this article will help.

Problems with Absolute Positioning

Obi-wan states that only the Sith deal in absolutes, and I agree with him entirely in this case. Absolute positioning is almost pure evil for a Web designer. The first time I tried to convert a site to Web standards, I used the seemingly simple absolute positioning. The beauty of this is that you could even drag your page elements around in a WYSIWYG HTML editor, and achieve the perfect desired layout instantly. But there is some ugliness inherent in absolute positioning.

As I mentioned, it’s easy to configure the layout and display your site perfectly on your computer. But that’s where the easiness ends. Try rendering your site on another computer with a different screen resolution. Chances are the site is slightly or extremely different than you designed. Even if you the same resolution, but a different browser, you’ll see minor and sometimes major variations.

The only possible way to manage this would be create separate style sheets for each standard resolution (currently there are more or less five common resolutions). Then you’d need a JavaScript include file to dynamically detect the screen size, and try to load the closest appropriate style sheet. The potential fail points here are numerous, and the amount of work to maintain five or more style sheets is ridiculous. And of course, if you have dynamic content on your site, this introduces another variable in the rendering, virtually impossible to design for with absolute positioning.

Well, now that I've completely bashed absolute positioning, I’ll move on to the positive part of the article!


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...
- CSS3 Animated Image Gallery: Transitions
- CSS3 Properties: Fixed Heights with box-sizi...
- CSS3 Properties: Altering Strokes and 3D Eff...
- CSS3 Properties: Text-Stroke
- CSS3 Transitions: Width and Height Properties
- Creating a Drop Down Menu in CSS3
- Intro to CSS Transitions

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials