I've made a rough layout for my site, but it is appearing differently in IE and Firefox, it shows how I want it to look in IE, but Firefox moves down the heading and the content text below it.
I have padding above the heading text, then a few breaks between the heading text and the content text. I've played about with these but to no avail. I want it to look in Firefox how it already does in IE, so how do I fix it?
Thanks,
GT
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="css/main.css" />
<title>Site Title</title>
</head>
<body>
<div id="container">
<div id="logonav">
<br />
<br />
<br />
<br />
<a class="home" href="index.htm">HOME</a><br/>
<a class="breakfast" href="breakfast.htm">BREAKFAST</a><br/>
<a class="lunch" href="lunch.htm">LUNCH</a><br/>
<a class="dinner" href="dinner.htm">DINNER</a><br/>
<a class="desserts" href="desserts.htm">DESSERTS</a><br/>
</div>
<div id="content">
<h2>Site Title</h2>
<br />
<br />
<br />
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.
</p>
<p>
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit
amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam
nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,
sed diam voluptua.
</p>
</div>
</div>
</body>
</html>
Different browsers use differing default margins & padding for elements such as a H2. As you haven't specified any, that is why the gaps differ. I would remove all the <br />s and add margin & padding values to all the elements you are having issues with.
Also, any reason you used H2 instead of H1 - They need to be semantic (ie. in correct order) for the page to validate, if i remember rightly.
Tim Denton
Graphic Designer for web, multimedia and interactive in Cardiff, Wales, UK.
"in HTML, H2 elements should follow H1 elements, H3 elements should follow H2 elements, etc. Content developers should not "skip" levels (e.g., H1 directly to H3)" - http://www.w3.org/TR/WCAG10-HTML-TEC...cument-headers
Tim Denton
Graphic Designer for web, multimedia and interactive in Cardiff, Wales, UK.
Sorted that problem out now, but I was wondering..
I have my main content div with a left and right border, that runs from the top of the div down to where the text finishes. How do I make it so that the div (and therefore the borders) always extend to the bottom of the browser window?
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Brian W. Kernighan
Bookmarks