![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
|
XHTML/CSS Div formatting problem
Hello guys, I'm having a bit of a problem with formatting divs for my website, and I would like some help with this. I've got a nav bar div that I would like to extend all the way to the bottom of the screen, so i assumed that height:100%; would be sufficient enough, but since testing it, I've discovered that it isn't. I've also read about it online, and apparently there are some errors with this.
I've tried setting the height element of the body, and all parent divs to 100% also, but I haven't had any luck. This is for a website I'm designing for a competition and also probably my school. <URL snipped> Note: The site will probably not look as it is intended unless you're on Firefox at 1024x768 resolution as I'm not really done making it, and a lot of its scripts (ie. the poll on the left) are not working yet. Last edited by Ancient Dragon; Feb 27th, 2008 at 11:05 PM. Reason: removed URL |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Re: XHTML/CSS Div formatting problem
post code or a valid URL
__________________
i dont know much about programming but i try to help |
|
|
|
|
|
#3 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Re: XHTML/CSS Div formatting problem
Try setting the html element's height to 100% too. Some browsers need it, some don't.
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
Re: XHTML/CSS Div formatting problem
insn't that a hack?
__________________
i dont know much about programming but i try to help |
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Re: XHTML/CSS Div formatting problem
Nope. Some browsers treat html as a rendering element, and some don't. I don't know whether the W3C tells them to or not, but it's unimportant - it's hardly hacky.
|
|
|
|
|
|
#6 |
|
Hobbyist Programmer
|
Re: XHTML/CSS Div formatting problem
I thouhgt desinging to specific browsers was bad... of course the most popular browser doesn't follows W3C standards.
__________________
i dont know much about programming but i try to help |
|
|
|
|
|
#7 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Re: XHTML/CSS Div formatting problem
Which is why it's accepted, if not ideal. Just get your website working in all browsers: how you do it is irrelevant.
|
|
|
|
|
|
#8 |
|
Programmer
|
Re: XHTML/CSS Div formatting problem
There is a change when I add height:100; to the HTML element, but it isn't the change I was looking for. I will show you guys my code.
index.php <html>
<head>
...
</head>
<body>
<div id="container">
...
<div id="leftBar">
...
</div>
...
</div>
</body>
</html>stylesheets html {
height:100%;
}
body {
/* Code for the body element */
font-family: Arial;
font-size: 13px;
margin:0 0 0 0;
padding:0;
background-color:#EEEEEE;
height:100%;
}
...
#container {
/* Code for the entirety of the page... contains the page */
margin:0;
border:thin;
border-color:#000000;
text-align:left;
height:100%;
}
...
#leftBar {
/* Code for the left sidebar */
height:100%;
margin-top:0;
margin-bottom:0px;
padding-left:5px;
margin-right:20px;
padding-top:5px;
float:left;
width:19.5%;
height:100%;
background-image: url(../img/sideBar.jpg);
border-right: 1px solid #000000;
border-bottom: 1px solid #000000;
color:#000000;
overflow:visible;
}I removed large chunks of what I believed to be unimportant code to this situation. I don't know if this code will help, but I still can't get it to work how I would like it to. |
|
|
|
|
|
#9 |
|
Programmer
|
Re: XHTML/CSS Div formatting problem
Another problem I'm having is getting the layout to work properly in all browsers. My sidebar doesn't reach the top on any browser I've tested other than Firefox, and on IE and Opera, the <hr /> tags that I have dividing news posts don't seem to be lining up how I'd like. I'll add my url to my signature if people would like to take a look.
If you do look, I'd suggest viewing it on Firefox at 1024x768 to see it how it's intended. |
|
|
|
|
|
#10 |
|
multigamer
Join Date: Mar 2008
Location: thelandofnoddy who has an addictio to vista, why has he becom sucha warped creature asthus?<("<)kirb
Posts: 13
Rep Power: 0
![]() |
Re: XHTML/CSS Div formatting problem
is this comp of which you speak being the thinkquest?
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Challenging Programming Problem - "Pinball Ranking" | Sane | Coder's Corner Lounge | 38 | Jan 15th, 2008 5:16 PM |
| Problem solving | ReggaetonKing | Software Design and Algorithms | 7 | Jan 4th, 2008 1:49 PM |
| problem processing file into a char array | csrocker101 | C++ | 1 | May 8th, 2007 11:50 PM |
| cgi/perl script + IE problem | joyceshee | Perl | 2 | Jan 24th, 2006 11:10 AM |
| problem with user defined class mixed with functions | willj729 | C++ | 4 | Oct 9th, 2005 3:26 PM |