Topic: 100% height (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: beyond the WEB! |
![]() Is this possible in CSS?? I'm stumpped! |
Maniac (V) Mad Scientist From: :morF |
![]() Well, in CSS terms a size of 100% is defined as being 100% of it's containing element, whereas most of the things I've seen will reder it as 100% of it's contained element. If it's possible... I'm not really sure. It's supposed to be. But there's a world of difference between 'supposed' and 'works'. |
Paranoid (IV) Inmate From: Florida |
![]() code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title></title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <style type="text/css"> html, body { height: 100%; } </style> </head> <body> <div></div> </body> </html> |
Maniac (V) Mad Scientist From: :morF |
![]() Yes, becuase code and nothing else tells a lot reisio... |
Maniac (V) Inmate From: under the bed |
![]() It does if you read it |
Maniac (V) Mad Scientist From: :morF |
![]() DL: To me, yes, mate, it does. But it's not me I was talking about there. I, and this may just be my own personal opinion, think that if you're going to put code examples up you should at least explain them for the hard of understanding. |
Paranoid (IV) Inmate From: Florida |
![]() Sorry, I figured that since the question was about CSS, you would skip to the CSS part of the code, which is merely 4 lines. |
Paranoid (IV) Mad Scientist From: Inside THE BOX |
![]() |
Paranoid (IV) Inmate From: Florida |
![]() O-kay... |
Maniac (V) Inmate From: under the bed |
![]() That aside.... |
Paranoid (IV) Inmate From: beyond the WEB! |
![]() I know that in CSS 100% height is meant with relation to the parent element but i've already tried what reisio showed above. I've made the html and body tages 100% height but nothing happens. Niether browser recognizes it. Infact i've even added 100% height to the main container but still nothing happens! |
Paranoid (IV) Inmate From: Florida |
![]() You could just post the source code. |
Paranoid (IV) Inmate From: beyond the WEB! |
![]() quote:
|
Paranoid (IV) Inmate From: Florida |
![]() Ah, I thought you just couldn't upload from college...I guess your source is just at home. |
Paranoid (IV) Inmate From: beyond the WEB! |
![]() I'm back home! code: body { margin: 0 auto; padding: 0; width: 744px; text-align: center; } html, body { height: 100%;} #main { margin: 0; padding: 0; text-align: left; width: 744px; height: 100%; }
|
Paranoid (IV) Inmate From: Florida |
![]() quote:
quote:
code: #nav ul li { list-style-type: none; margin: 0; padding: 0; }
code: #nav ul li { list-style-type: none; margin: 0; padding: 0; display: inline; }
code: body { margin: 0 auto; padding: 0; width: 400px; text-align: center; } /* layout */ #nav { margin: 75px 0 0 0; padding: 0; width: 400px; text-align: center; }
code: body { margin: 0 auto; padding: 0; width: 400px; } /* layout */ #nav { margin: 75px 0 0 0; padding: 0; width: 400px; }
code: #nav ul li a { display: block; height: 100%; padding: 4px 0 4px 10px; }
code: #nav ul li a:link { font: 11px Verdana, Arial, sans-serif; color: #fff; text-decoration: none; display: block; padding: 4px 0 4px 10px; margin: 0; } #nav ul li a:visited { font: 11px Verdana, Arial, sans-serif; color: #fff; text-decoration: none; display: block; padding: 4px 0 4px 10px; margin: 0; } #nav ul li a:active { font: 11px Verdana, Arial, sans-serif; color: #fff; text-decoration: none; display: block; padding: 4px 0 4px 10px; margin: 0; } #nav ul li a:hover { font: 11px Verdana, Arial, sans-serif; color: #000; text-decoration: none; display: block; background-color: #c4e52a; padding: 4px 0 4px 10px; margin: 0; }
code: #nav ul li a:link { font: 11px Verdana, Arial, sans-serif; color: #fff; text-decoration: none; display: block; margin: 0; } #nav ul li a:visited { font: 11px Verdana, Arial, sans-serif; color: #fff; text-decoration: none; display: block; margin: 0; } #nav ul li a:active { font: 11px Verdana, Arial, sans-serif; color: #fff; text-decoration: none; display: block; margin: 0; } #nav ul li a:hover { font: 11px Verdana, Arial, sans-serif; color: #000; text-decoration: none; display: block; background-color: #c4e52a; margin: 0; }
code: p { margin: 1em 0; } h1 { margin: 1em 0; } |
Maniac (V) Mad Scientist From: :morF |
![]() IE renders 100% in a faulty way. it will render it as 100% of the containing window, and if there's margins or padding on top of that pretty soon you start scrolling outside the screen for no damn reason. |
Paranoid (IV) Inmate From: Florida |
![]() quote:
|
Paranoid (IV) Inmate From: beyond the WEB! |
![]() Actually that was all the CSS for the height problem still if you want the rest here: code: body { margin: 0 auto; padding: 0; width: 744px; text-align: center; } html, body { height: 100%;} /* layout */ #main { margin: 0; padding: 0; text-align: left; width: 744px; height: 100%; } #head { margin: 0; padding: 0; background: url(images/head.gif) top left no-repeat; width: 744px; height: 160px; float: left; } #content { margin: 0 0 0 24px; padding: 0;} #left { background-color: #b4e140; width: 119px; text-align: left; margin; 0; padding: 0; float: left; } #center { width: 452px; text-align: center; margin: 0; padding: 0; float: left; } #right { background-color: #f5f5f5; margin: 0; padding: 0; width: 149px; text-align: left; float: left; }
|
Paranoid (IV) Inmate From: beyond the WEB! |
![]() I'm starting to think it's the floats that are messing up the 100% height... as I recall I don't think a div which has floats in it has any height!! |
Paranoid (IV) Inmate From: Florida |
![]() It's much simpler to fix things if you provide the full source: CSS, HTML...everything. |
Paranoid (IV) Inmate From: beyond the WEB! |
![]() *looks embarassed* |
Paranoid (IV) Inmate From: Florida |
![]() Cool. |