Help - Search - Members - Calendar
Full Version: Webpage that fits ANY resolution
Pixel2Life Forum > Member Tutorials and Requests > Tutorial Requests
hughveal
I have a few Dreamweaver web pages out on the internet and try as I might to get them to fit all resolutions, I find that elements shift left and right with different resolutions. Is there a way to set them to always show centered no matter what the user's resolution is?
Demonslay
Depends on how your layout is set, but this is how I usually do it.


CODE
HTML:
<div id="container">
<!-- All my page here -->
</div>

CSS Rule:
div#container{
margin: 0 auto;
width: 800px; // Or however big your content needs to be if it isn't to be fully flexible
}


If its a fluid layout you need, to stretch the whole page, you might have to play with it a bit. I've not made a layout of that kind in a long time, so I don't really remember how exactly, but it would have to do with floats and percentage widths that can get complicated when it comes to cross-browser compatibility (thanks to IE of course...).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.