Jump to content

all browsers and resolutions


ngreenwood6

Recommended Posts

I am just trying to set up a page that will display centered with any resolution. For example this website. If you minimize it it still keeps thoses little borders around the outside. I am working with a 1280x1024 resolution (internet explorer) and if I take it down to 800x600 it still displays it the same way. Firefox displays it the same way though. I was hoping that someone could give me an example of how to do this because no matter what I try it does not work. I could also go with something like www.laptoprescue.com where when you change the resolution to 800x600 it just fits to the page rather than being centered. I just cannot seem to get mine to work like that. Any help is appreciated.

Link to comment
Share on other sites

I could also go with something like www.laptoprescue.com where when you change the resolution to 800x600 it just fits to the page rather than being centered.

 

This site is a "fixed-width" layout. It's container, and all the layout graphics, is fixed at 800px wide ... no more, no less.

#container {
  margin: 0 auto;
  width: 800px;
  height:100%;
  text-align:left;
  border:1px solid #000000;
}

 

It's margin is set at margin:0 auto - this tells the browser to use "auto" left/right margins - so as soon as the screen exceeds 800px the container is auto centered (auto default margins each side).

 

It all depends on the  width of your main container select. You can use percentages, too, if you want, like so:

#container {
  margin: 0 auto;
  width: 80%;
  border:1px solid #000000;
}

 

Now the container will resize and stay centered (@10% margin each side) no matter how small or how wide (and depending upon content and embedded graphics of course).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.