naiani
08-13-2007, 06:52 PM
Hello everyone.
I have 2 questions about a header + 3 columns + footer layout, based on the one from this website: http://css.maxdesign.com.au/floatutorial/tutorial0916.htm. First, codes; then, questions.
CSS:
#container {
width: 90%;
margin: 0 auto;
background-color: #fff;
color: #000;
border: 1px dotted #ff0000;
line-height: 130%;
}
#title {
height: 152px;
background-image: url(titlebg_alt.jpg);
background-repeat: repeat-y;
background-color: #bab3d4;
background-position: left;
border-bottom: 2px solid #fff;
}
#title img#logo {
general formatting code
}
#title img#cglg {
general formatting code
}
#title img#cto {
general formatting code
}
#menu {
background-image: url(menubg_gold.jpg);
background-repeat: repeat-x;
background-position: top;
float: left;
width: 165px;
margin: 0;
padding: 0;
border-top: 10px solid #ba960e;
border-right: 2px solid #ba960e;
clear: left;
}
#menu ul {
list-style: none;
margin: 0;
padding: 0;
}
#menu a {
font: bold 0.8em Verdana, Arial, sans-serif;
color: #000066;
text-decoration: none;
text-align: right;
padding: 3px 5px 4px 0;
border-bottom: #000066 solid 1px;
height: 2.5em;
display: block;
}
#menu a:active {
color: #fff;
background-color: #ba960e;
border-right: thick solid #000066;
}
#menu ul ul {
position: absolute;
top: 0;
left: 100%;
width: 100%;
}
#menu ul ul li {
margin-bottom: -1px;
}
#menu ul ul li a {
border: 1px solid #ba960e;
color: #fff;
padding-bottom: 5px;
height: 2.3em;
}
#menu li {
position: relative;
}
div#menu ul ul {
display: none;
background-color: #000066;
}
div#menu ul li:hover ul {
display: block;
}
div#menu ul li:hover > a {
color: #fff;
background-color: #ba960e;
border-right: thick solid #000066;
padding-right: 2px;
}
#news {
font: 0.8em Verdana, Arial, sans-serif;
line-height: 130%;
float: right;
width: 230px;
margin: 0;
padding: 1em;
border-top: 10px solid #ba960e;
border-left: 2px dotted #ba960e;
}
#news ul {
list-style: none;
margin: 0;
padding: 0;
}
#content {
font: 0.9em Verdana, Arial, sans-serif;
text-align: justify;
margin-left: 165px;
padding-left: 1em;
margin-right: 230px;
padding-right: 1em;
border-top: 10px solid #ba960e;
max-width: 45em;
}
#content img {
vertical-align: top;
float: right;
heigth: 226px;
width: 188px;
top: 0px;
right: 0px;
padding-left: 10px;
}
#footer {
font: 0.75em Verdana, Arial, sans-serif;
clear: both;
margin: 0;
padding: 0.5em;
border-top: 2px solid #ba960e;
}
hr {
display: none;
}
HTML:
<body>
<div id="container">
<div id="title">
<img src="bluelogo_sml.jpg" id="logo" alt="CGLG" />
<img src="title.png" alt="The Council of Great Lakes Governors" id="cglg" /><br />
<img src="subtitle.png" alt="Canadian Trade Office" name="cto" id="cto" />
</div>
<hr id="divider" />
<div id="menu">
<ul>
<li><a href="index.html" target="_parent">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">State Partners</a>
<ul>
<li><a href="#">Pennsylvania</a></li>
<li><a href="#">Wisconsin</a></li>
</ul>
</li>
<li><a href="#">Services</a></li>
<li><a href="#">Export Documents</a>
<ul>
<li><a href="#">Canadian Customs Invoice</a></li>
<li><a href="#">NAFTA Certificate of Origin</a></li>
<li><a href="#">Harmonized Tariff Codes</a></li>
<li><a href="#">Cargo Control Document</a></li>
<li><a href="#">Bill of Lading</a></li>
<li><a href="#">Taxes</a></li>
<li><a href="#">Consumer Packaging and Labeling</a></li>
<li><a href="#">Role of a Customs Broker</a></li>
</ul>
</li>
<li><a href="#">Visiting Canada</a>
<ul>
<li><a href="#">Visa and Immigration</a></li>
<li><a href="#">Business Culture</a></li>
<li><a href="#">FAQs</a></li>
</ul>
</li>
<li><a href="#">Business Opportunities</a></li>
<li><a href="#">Links</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
<div id="imgslide">
<script type="text/javascript" src="imgslide.js"></script>
</div>
</div>
<hr id="divider" />
<div id="content">
<p><img id="imgfront" src="imgfront.jpg" />The Canadian Trade Office of the Council of Great Lake Governors provides SMEs in our partner states of <a href="#">Pennsylvania</a> and <a href="#">Wisconsin</a>, with an invaluable resource in the Canadian market. Our professional staff can assist companies to research, identify and capitalize on market opportunities in a broad range of industry sectors across Canada.</p>
<hr id="divider" />
<div id="news">
<div id="updates">
<h3>Updates</h3>
<ul>
<li><strong>August 09, 2007</strong> - Mandatory nutritional labelling implementation period coming to an end. <a href="#" onclick="return overlay(this, 'subcontent', 'bottom')">More >></a></li>
<li><strong>January 23, 2007</strong> - New American law concerning the need of passport when entering the U.S. by air. <a href="#" onclick="return overlay(this, 'subcontent', 'bottom')">More >></a></li>
</ul>
</div>
<div id="subcontent">
<script type="text/javascript">
showPage('ddbox1.html', 'subcontent')
</script>
</div>
<br />
<hr />
<div id="cadusnews"><h3>Canada/U.S. News:</h3>
<script type="text/javascript">
var newsfeed=new gfeedfetcher("rssnews", "rssnewsclass", "_new")
newsfeed.addFeed("CBC", "http://rss.cbc.ca/lineup/money.xml")
newsfeed.addFeed("Globe&Mail", "http://www.theglobeandmail.com/generated/rss/BN/Business.xml")
newsfeed.addFeed("CNN", "http://rss.cnn.com/rss/money_latest.rss")
newsfeed.addFeed("MSNBC", "http://rss.msnbc.msn.com/id/3174182/device/rss/rss.xml")
newsfeed.displayoptions("datetime label")
newsfeed.setentrycontainer("li")
newsfeed.filterfeed(6, "datetime")
newsfeed.init()
</script>
</div>
</div>
<hr id="divider" />
<div id="footer">
<span><a href="index.html" target="_self">Home</a> | <a href="#">About Us</a> | <a href="#">State Partners</a> | <a href="#">Services</a> | <a href="#">Export Documents</a><br />
<a href="#">Visiting Canada</a> | <a href="#">Business Opportunities</a> | <a href="#">Links</a> | <a href="#">Contact Us</a></span>
<br />
<span>All Rights Reserved. 2007. Developed by <a href="#" id="webdev">Naiani Rosa de Barros</a></span>
</div>
</div>
</body>
I've posted only the <body> content, because it's the only relevant part. The <head> section just calls the external CSS file (the one I posted) and a few JavaScripts that have nothing to do with the design. The code doesn't work either on FF or IE7.
Problem #1: the #menu column is not following the height of the #container div. I know about the issues concerning the rendering of the height attribute, but was wondering why it doesn't work in this case, since the code from the tutorial works perfectly.
Problem #2: the right column, #news, doesn't stick to the bottom of the #header. It's like there's a clear: right defined for the #content column, or a clear: left for the #news one. But there are none of them.
I've tried to fix them by so many ways, I don't know what to do anymore, and I have no idea about why are these things happening, so, any help is more than welcome.
Thanks everyone, and forgive me if my English is not very clear.
I have 2 questions about a header + 3 columns + footer layout, based on the one from this website: http://css.maxdesign.com.au/floatutorial/tutorial0916.htm. First, codes; then, questions.
CSS:
#container {
width: 90%;
margin: 0 auto;
background-color: #fff;
color: #000;
border: 1px dotted #ff0000;
line-height: 130%;
}
#title {
height: 152px;
background-image: url(titlebg_alt.jpg);
background-repeat: repeat-y;
background-color: #bab3d4;
background-position: left;
border-bottom: 2px solid #fff;
}
#title img#logo {
general formatting code
}
#title img#cglg {
general formatting code
}
#title img#cto {
general formatting code
}
#menu {
background-image: url(menubg_gold.jpg);
background-repeat: repeat-x;
background-position: top;
float: left;
width: 165px;
margin: 0;
padding: 0;
border-top: 10px solid #ba960e;
border-right: 2px solid #ba960e;
clear: left;
}
#menu ul {
list-style: none;
margin: 0;
padding: 0;
}
#menu a {
font: bold 0.8em Verdana, Arial, sans-serif;
color: #000066;
text-decoration: none;
text-align: right;
padding: 3px 5px 4px 0;
border-bottom: #000066 solid 1px;
height: 2.5em;
display: block;
}
#menu a:active {
color: #fff;
background-color: #ba960e;
border-right: thick solid #000066;
}
#menu ul ul {
position: absolute;
top: 0;
left: 100%;
width: 100%;
}
#menu ul ul li {
margin-bottom: -1px;
}
#menu ul ul li a {
border: 1px solid #ba960e;
color: #fff;
padding-bottom: 5px;
height: 2.3em;
}
#menu li {
position: relative;
}
div#menu ul ul {
display: none;
background-color: #000066;
}
div#menu ul li:hover ul {
display: block;
}
div#menu ul li:hover > a {
color: #fff;
background-color: #ba960e;
border-right: thick solid #000066;
padding-right: 2px;
}
#news {
font: 0.8em Verdana, Arial, sans-serif;
line-height: 130%;
float: right;
width: 230px;
margin: 0;
padding: 1em;
border-top: 10px solid #ba960e;
border-left: 2px dotted #ba960e;
}
#news ul {
list-style: none;
margin: 0;
padding: 0;
}
#content {
font: 0.9em Verdana, Arial, sans-serif;
text-align: justify;
margin-left: 165px;
padding-left: 1em;
margin-right: 230px;
padding-right: 1em;
border-top: 10px solid #ba960e;
max-width: 45em;
}
#content img {
vertical-align: top;
float: right;
heigth: 226px;
width: 188px;
top: 0px;
right: 0px;
padding-left: 10px;
}
#footer {
font: 0.75em Verdana, Arial, sans-serif;
clear: both;
margin: 0;
padding: 0.5em;
border-top: 2px solid #ba960e;
}
hr {
display: none;
}
HTML:
<body>
<div id="container">
<div id="title">
<img src="bluelogo_sml.jpg" id="logo" alt="CGLG" />
<img src="title.png" alt="The Council of Great Lakes Governors" id="cglg" /><br />
<img src="subtitle.png" alt="Canadian Trade Office" name="cto" id="cto" />
</div>
<hr id="divider" />
<div id="menu">
<ul>
<li><a href="index.html" target="_parent">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">State Partners</a>
<ul>
<li><a href="#">Pennsylvania</a></li>
<li><a href="#">Wisconsin</a></li>
</ul>
</li>
<li><a href="#">Services</a></li>
<li><a href="#">Export Documents</a>
<ul>
<li><a href="#">Canadian Customs Invoice</a></li>
<li><a href="#">NAFTA Certificate of Origin</a></li>
<li><a href="#">Harmonized Tariff Codes</a></li>
<li><a href="#">Cargo Control Document</a></li>
<li><a href="#">Bill of Lading</a></li>
<li><a href="#">Taxes</a></li>
<li><a href="#">Consumer Packaging and Labeling</a></li>
<li><a href="#">Role of a Customs Broker</a></li>
</ul>
</li>
<li><a href="#">Visiting Canada</a>
<ul>
<li><a href="#">Visa and Immigration</a></li>
<li><a href="#">Business Culture</a></li>
<li><a href="#">FAQs</a></li>
</ul>
</li>
<li><a href="#">Business Opportunities</a></li>
<li><a href="#">Links</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
<div id="imgslide">
<script type="text/javascript" src="imgslide.js"></script>
</div>
</div>
<hr id="divider" />
<div id="content">
<p><img id="imgfront" src="imgfront.jpg" />The Canadian Trade Office of the Council of Great Lake Governors provides SMEs in our partner states of <a href="#">Pennsylvania</a> and <a href="#">Wisconsin</a>, with an invaluable resource in the Canadian market. Our professional staff can assist companies to research, identify and capitalize on market opportunities in a broad range of industry sectors across Canada.</p>
<hr id="divider" />
<div id="news">
<div id="updates">
<h3>Updates</h3>
<ul>
<li><strong>August 09, 2007</strong> - Mandatory nutritional labelling implementation period coming to an end. <a href="#" onclick="return overlay(this, 'subcontent', 'bottom')">More >></a></li>
<li><strong>January 23, 2007</strong> - New American law concerning the need of passport when entering the U.S. by air. <a href="#" onclick="return overlay(this, 'subcontent', 'bottom')">More >></a></li>
</ul>
</div>
<div id="subcontent">
<script type="text/javascript">
showPage('ddbox1.html', 'subcontent')
</script>
</div>
<br />
<hr />
<div id="cadusnews"><h3>Canada/U.S. News:</h3>
<script type="text/javascript">
var newsfeed=new gfeedfetcher("rssnews", "rssnewsclass", "_new")
newsfeed.addFeed("CBC", "http://rss.cbc.ca/lineup/money.xml")
newsfeed.addFeed("Globe&Mail", "http://www.theglobeandmail.com/generated/rss/BN/Business.xml")
newsfeed.addFeed("CNN", "http://rss.cnn.com/rss/money_latest.rss")
newsfeed.addFeed("MSNBC", "http://rss.msnbc.msn.com/id/3174182/device/rss/rss.xml")
newsfeed.displayoptions("datetime label")
newsfeed.setentrycontainer("li")
newsfeed.filterfeed(6, "datetime")
newsfeed.init()
</script>
</div>
</div>
<hr id="divider" />
<div id="footer">
<span><a href="index.html" target="_self">Home</a> | <a href="#">About Us</a> | <a href="#">State Partners</a> | <a href="#">Services</a> | <a href="#">Export Documents</a><br />
<a href="#">Visiting Canada</a> | <a href="#">Business Opportunities</a> | <a href="#">Links</a> | <a href="#">Contact Us</a></span>
<br />
<span>All Rights Reserved. 2007. Developed by <a href="#" id="webdev">Naiani Rosa de Barros</a></span>
</div>
</div>
</body>
I've posted only the <body> content, because it's the only relevant part. The <head> section just calls the external CSS file (the one I posted) and a few JavaScripts that have nothing to do with the design. The code doesn't work either on FF or IE7.
Problem #1: the #menu column is not following the height of the #container div. I know about the issues concerning the rendering of the height attribute, but was wondering why it doesn't work in this case, since the code from the tutorial works perfectly.
Problem #2: the right column, #news, doesn't stick to the bottom of the #header. It's like there's a clear: right defined for the #content column, or a clear: left for the #news one. But there are none of them.
I've tried to fix them by so many ways, I don't know what to do anymore, and I have no idea about why are these things happening, so, any help is more than welcome.
Thanks everyone, and forgive me if my English is not very clear.