Forum Moderators: not2easy
I have defined the following CSS rules
{
margin: 0 0;
padding: 0 0;
}
body
{
background-color: #FFFFCC;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 24px;
color: #336699;
padding-left: 10px;
}
#Head
{
position: relative;
width: 955px;
height: 100px;
background-repeat: no-repeat;
background-image: url(../Images/ClearFullLogo.gif);
z-index: 2;
left: 10px;
top: 0px;
border-bottom-width: thin;
border-bottom-style: solid;
border-bottom-color: #000000;
}
#NavPanel
{
position: relative;
width: 88px;
height: 499px;
z-index: 1;
left: 0px;
top: 0px;
padding-left: 10px;
float:left;
}
#Content
{
position: relative;
width: 858px;
height: 499px;
z-index: 3;
padding-left: 10px;
border-bottom-width: medium;
border-top-style: none;
border-bottom-style: solid;
}
#Content #Introflash
{
margin-left: 10px;
/*margin-top: 20px;*/
position:relative;
top:20px;
margin-bottom: 20px;
float: left;
display:block;
}
#HeadComment
{
position:absolute;
width:323px;
height:75px;
z-index:1;
left: 338px;
top: 24px;
}
#Container
{
position: relative;
margin: 0 0 0 0;
padding: 0 0 0 0;
}
I have the following XHTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>xi amdfio as</title>
<link href="Styles/base.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
-->
</style>
</head>
<body>
<div id="Container">
<div class="header" id="Head">
<div id="HeadComment">
jkdfa kard9; aierer
</div>
</div>
<div class="nav" id="NavPanel">
<a href="afei;a.html" title="j;fsrtr">Home</a> <br />
<a href="aerer.html" title="aera Offered">areea</a><br />
<a href="wraerr.html" title="aerea s">arera a</a><br />
</div>
<div id="Content" style="left: 0px; top: 0px">
<div id="Introflash">
<object type="application/x-shockwave-flash" data="Animations/CodeClutter.swf" width="300" height="300">
<param name="movie" value="Animations/CodeClutter.swf" />
<param name="loop" value="false" /><param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<img src="Images/CodeClutter.gif" width="300" height="300" alt="kjdfrera ifkjaerap" />
</object>
</div>
<div style="padding-left:500px; margin-top:100px">
<img src="Images/Quetioner.gif" alt="Person with a question" />
</div><br />
<div style="margin-left:20px; margin-right:30px;clear:both">
kdjfara jadjfoeir aiue rakdr iearprer aeoirua iarteareu oierapirua iuaeru ar u .</div>
</div>
</div>
</body>
</html>
As you can see I have not explicitly defined this extra space and want to get rid of it and still display correctly in both browsers.
#Content #Introflash is the proper hierarchy. #Introflash is within #Content. He's not trying to apply those values to both #Content and #Introflash (or is he? :D). Secondly, it's not just Firefox that you're getting extra "space" - it's IE too, once you resize the browser width small enough.
The problem is you're floating your left menu, but not your right content (
#Introflash is, but it's #Content that needs to be) - so it's still displaying block, and taking up the entire width of the screen (thus the effect of extra "space" when in reality it's just pushed below the menu.) As many asides go:
/Images/ClearFullLogo.gif, or anything, especially things a user has to type (they get confused easily) and it's just easier for consistency if they get avoided altogether; border-bottom-width, border-bottom-style, border-bottom-color properties can be combined: border: thin solid #000; (same goes for margin: 0 0 0 0; = margin: 0; and background-repeat, background-image = background) * { margin: 0; padding: 0; } (* is the wildcard that will apply to all elements - at that specificity) #FFFFCC) can be reduced down to #ffc font-size in absolute sizing is baaad - IE cannot resize that according to user, which is a plus for accessibility.P.S.: Sorry for being nitpicky :)