|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 7
|
Page doesn't display correctly in IE6 but is fine for FF and IE8
Hello,
I am a beginner at web page design and have tried to use css to develop my first web page. The page looks fine in IE8 as well as Firefox but in IE6, the main content is way at the bottom and the header is tiled or something for some reason. I am certain this is a newbie mistake I am making. I am going to post the code. Can someone kindly glance over it for newbie mistakes or anything that is obvious to cause these problems? I assume it is a problem with my CSS code crossing between different browsers. The code is very small. Nvm, i cannot post because I don't have enough posts. The source code can be pulled from the website at lespetitespommes dot com and this is my CSS: Code:
#container {
width: 850px;
margin-right: auto;
margin-left: auto;
}
#header {
height: 201px;
width: 850px;
background-color: #DE1621;
}
#content {
width: auto;
height: 1090px;
padding: 10px;
margin-left: 125px;
background-color: #FFFF99;
}
#leftnav {
float: left;
width: 115px;
height: 1100px;
background-color: #DE1621;
padding: 5px;
}
#leftnav ul
{
margin-left: 0;
padding-left: 0;
list-style-type: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
#leftnav a
{
display: block;
width: 130px;
padding-top: 3px;
padding-right: 3px;
padding-bottom: 3px;
padding-left: 3px;
border-bottom-width: 1px;
}
#leftnav a:link, .navlist a:visited
{
color: #ffffff;
text-decoration: underline;
font-weight: bold;
}
#leftnav a:visited
{
color: #ffffff;
text-decoration: underline;
font-weight: bold;
}
#leftnav a:hover
{
text-decoration: none;
color: #0000ff;
}
#sidebar {
padding: 10px;
float: right;
width: 130px;
background-color: #DE1621;
height: 390px;
}
#footer {
background-color: #DE1621;
padding: 10px;
clear: both;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
}
h1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 22px;
font-weight: bold;
color: #1A2373;
line-height: 24px;
}
h2 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 17px;
font-weight: bold;
color: #2F77F1;
line-height: 20px;
}
h3 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bolder;
color: #000000;
line-height: 20px;
}
p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 11pt;
margin-top: 3px;
margin-right: 0;
margin-bottom: 3px;
margin-left: 0;
padding-bottom: 9px;
}
a {
color: #E82525;
font-weight: bold;
text-decoration: underline;
}
a:visited {
color: #E82525;
text-decoration: underline;
font-weight : bold;
}
a:hover {
color: #901BBE;
text-decoration: none;
}
.box1 {
background:#ffffff;
color: #000;
border:1px solid #00ffff;
width: 400px;
height: 165px;
padding-top: 5;
padding-right: 6px;
padding-bottom: 0;
padding-left: 6px;
line-height: 16px;
}
.smalltext {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
padding: 3px 0;
margin: 3px 0;
line-height: 12pt
}
Charles Last edited by Paul O'B; Sep 15, 2009 at 09:14. Reason: code tags added |
|
|
|
|
|
#2 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 7
|
Ok, it seems I have fixed all the alignment issues except for the content being below the left nav for some reason.
To fix the alignment issues, I changed display:block to display:inline #leftnav a { display: block; width: 130px; padding-top: 3px; padding-right: 3px; padding-bottom: 3px; padding-left: 3px; border-bottom-width: 1px; } |
|
|
|
|
|
#3 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 7
|
I have uploaded pics of the site from IE6 and FF. You can see that the main content isn't at the correct placement in IE6 - it should be below header but to the right of the navigation bar as seen in FF... However, in IE6, it is actually BELOW the left navigation bar (it's not pictured because I have to scroll down to see the main content)
I am certain there is a quick fix in CSS but i can't figure it out ![]() |
|
|
|
|
|
#4 |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2007
Location: Texas
Posts: 1,982
|
Hi,
IE6 is the only browser that will stretch a containers width when it's inner contents exceed the parent's width. You have your #leftnav width at 125px total after side paddings are added in then you have your anchor set at 130px plus 6px total side padding. That has stretched your #leftnav and caused your content div to drop below the #leftnav float. You didn't have a width set on your content div but you have a 700px wide table in it. There is also one table in there that is 708px wide that needs to be sized down to 700px. (you really don't need those tables in there either) Change this to 700 - Code:
<p><strong>A MESSAGE FROM MARY:</strong></p> <table width=" Code:
#content {
/*width: auto;remove this*/
float:left;
width:705px;/*725px total with side padding*/
height: 1090px;
padding: 10px;
/*margin-left: 125px;remove this*/
background-color: #FFFF99;
}
#leftnav {
float: left;
width: 115px;/*125 total with side padding*/
height: 1100px;
background-color: #DE1621;
padding: 5px;
}
#leftnav ul
{
margin-left: 0;
padding-left: 0;
list-style-type: none;
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
}
#leftnav a
{
display: block;
width: 105px;/*115px total with side padding*/
padding:3px 5px;
/*border-bottom-width: 1px;remove this*/
}
|
|
|
|
|
|
#5 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 7
|
Thank you so much for your help! I really appreciate it.
You are correct - if I am not mistaken, using CSS you do not need any tables in html. Even as a beginner, I can see how powerful CSS can be. It seems like it would reduce TONS of html code for a large site. Thanks again! |
|
|
|
|
|
#6 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 3
|
Hi
I have the same problem with my website. It looks great in IE8. Firefox, Chrome and Safari but in IE6 my horizontal navigation is all over the place. I tried change widths of containers, change paddings but nothing works. Can somebody please help me with that, I will really appreciate that. I had to delete my navigation items because they contain links and I couldn't post it HTML4Strict Code:
CSS CSS Code:
|
|
|
|
|
|
#7 |
|
CSS Guru in Training
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: Whiteford, MD
Posts: 8,673
|
Hi, I'm not sure if this is the case as I can't do testing.
Jus tby studying your code I'm guessing your running into the staircase bug. Add float:left; to "ul#menu li" Please in the future don't hijack someoen elses thread . |
|
|
|
|
|
#8 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 3
|
It worked! Thank you very very much!
|
|
|
|
|
|
#9 |
|
CSS Guru in Training
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: Whiteford, MD
Posts: 8,673
|
Haha dang that's awesome
. Your welcome .
Off Topic: I am 4 cereal, looked at CSS only |
|
|
|
|
|
#10 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 3
|
You can call yourself just CSS Guru now![]() |
|
|
|
|
|
#11 |
|
CSS Guru in Training
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2008
Location: Whiteford, MD
Posts: 8,673
|
I would update my title but I don't want to be cocky ;P
|
|
|
|
|
|
#12 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 7
|
I actually just noticed that I had fixed the main page (change table width from 708 to 700 but forgot to do so on other pages).
Now when I modify all the other pages such that they are down to table width's of 700, I see a few problems. One of the replies to this thread had said the tables were actually unnecessary. Should I be removing them within the html? I'm not quite sure how to go about doing this while keeping the content intact. If they could be manually modified to work (dimensions), I would prefer that solution and that's how I've been trying to fix it so far. 1) The contents of one of my pages is shown incorrectly. I have attached screenshots of the page shown in IE6 and in Firefox (FF is the one that looks correct). -> lespetitespommes DOT com/about.html 2) Some of the pages I manually changed the table width to 700, I now see the left nav doesn't reach all the way down to the bottom as shown in another pic. - lespetitespommes DOT com/staff.html 3) One of my pages is still stuck beneath the left nav even though I changed the table width down to 700. -> lespetitespommes DOT com/photos.html Any help would be greatly appreciated? Thanks in advance! |
|
|
|
|
|
#13 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 7
|
Any ideas? I'm stuck
![]() |
|
|
|
|
|
#14 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,593
|
1) Add a class to the table and apply this style.
Code:
#content .about-table img{
display:block
}
Code:
<table class="about-table" width="700" border="0">
<tr>
<td width="350"><p>This summer I .........
Code:
<td width="324" valign="top"><p align="center"><img src="http://www.lespetitespommes.com/More Images/Thumbnails/sub_header_youth.jpg" alt="sc" width="350" height="44" align="top" /></p> 2) It only reaches down to the bottom because you set a height on it. Code:
#leftnav {
float: left;
width: 115px;
height: 1100px;
background-color: #DE1621;
padding: 5px;
}
3) Your images are 350px each so therefore they take up the full width already and therefore combined with the default cellspacing thge table becomes too big. as the table is nested the problem is doubled. Remove the cellspacing as shown. Code:
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><p><strong>Les Petites Pommes Summer 2009 Photos! </strong></p>
<p> </p>
<p>Please click on the session photos which you would like to view: </p>
<p> </p>
<table width="700" border="0" cellspacing="0" cellpadding="0">
|
|
|
|
|
|
#15 |
|
SitePoint Member
Join Date: Sep 2009
Posts: 7
|
Thank you for the response. I will read through your examples and the link you provided and then re-code the necessary parts.
![]() |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 15:01.






.



Linear Mode
