Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

T-Tutorials Tutorials Expert Coded FX GameXe 

Change Language

Who's online

There are currently 0 users and 1 guest online.

<div class="container">...</div> in full screen height position

Hi, I've been searching around the web looking for a piece of CSS to control the my <div class="container">...</div> to always fit across the screens height not dependent on screen size or resilution, and can be used in both IE and FF.

I have tried using:

.container
{
background: #000;
margin: 0 auto;
padding-bottom: 6px;
width: 850px;
border: 1px solid #CD0000;
height: 100%
}

but that failed!..

Please brush off some knowledge into my way.

Many thanks,
Vinstah


Submitted by vinstah on March 8, 2008 - 11:50am.
printer friendly version

Can't be done

Well, at least not without some hacks. There is no way to make a box 100% of the height of the screen with a single CSS command like "height: 100%". Though I wish it was that easy.

You will have to do a google search to find some of the ways others have accomplished this feat. Some use negative margins like "margin-bottom: -9999px;" and others just place a div around the content and the right/left side bar and set the background of that div to some image to make it LOOK like the side bar goes to the floor.

But like I said, you will have to get some half-browser-working CSS hack to do the trick.


Maybe the answer to my question?

after searching google with different terms I came across this helpful webpage --> http://www.geekicon.net/thinktank/index.shtml/article/643


Try to add height: 100% to

Try to add height: 100% to the body and all the other containers of your div if there is any. and I think it will work
Have fun


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br /> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will be automatically converted to links
More information about formatting options



Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati