Jump to content


Photo

Webpage that fits ANY resolution


  • Please log in to reply
1 reply to this topic

#1 hughveal

hughveal

    Young Padawan

  • Members
  • Pip
  • 2 posts
  • Gender:Male
  • Location:Morrisville, NC

Posted 02 November 2009 - 05:02 PM

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?

#2 Demonslay

Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 973 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 02 November 2009 - 08:16 PM

Depends on how your layout is set, but this is how I usually do it.


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...).




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users