sab3156
03-08-2008, 05:55 PM
Hey guys.
I am using CSS and div tags to create a layout for a webpage.
It is a 3 column layout with a top banner div and a bottom footer div.
My question is, how can I embed the #articlesnav div and the #librarynav div within the #right div, and have them float to the left within that div?
#container
{
width: 90%;
margin: 10px auto;
background-color: #fff;
color: #333;
border: 1px solid gray;
line-height: 130%;
}
body
{
text-align: center;
}
div#container
{
margin-left: 10px auto;
margin-right: 10px auto;
text-align: left;
}
#top
{
padding: .5em;
background-color: #9FA41D;
border-bottom: 1px solid gray;
text-align: left;
}
#top_banner {
float: left;
padding: 0;
text-align: left;
}
#top h1
{
padding: 0;
margin: 0;
}
#left
{
float: left;
width: 160px;
margin: 0;
}
#navlinks {
width: 160px;
float: left;
margin: 0;
padding: 1em;
}
#right
{
width: 160px;
float: right;
margin: 0;
}
#articlesnav
{
float: left;
width:160px;
margin:0;
}
#librarynav {
width:160px;
float: left;
margin:0;
}
#search {
float: right;
width: 160px;
margin: 0;
padding: 1em ;
}
#content
{
margin-left: 200px;
border-left: 1px solid gray;
margin-right: 200px;
border-right: 1px solid gray;
padding: 1em;
}
#footer
{
clear: both;
margin: 0;
padding: .5em;
color: #333;
background-color: #9FA41D;
border-top: 1px solid gray;
}
:confused: When I embed them into the #right div, they are aligned to the right and they flow over the right side of the side, and they have a bit too much margin space to the left... is this the padding of the #right div acting on the embedded divs?
Also, when i do this:
<div id="left">
<div id="navlinks">
<p><span class="navlink"><img src="img/doublerightarrow.gif"> <a href="template.html">Online Library</a></span></p>
<p><span class="navlink"><img src="img/doublerightarrow.gif"> <a href="template.html">Articles</a></span></p>
<p><span class="navlink"><img src="img/doublerightarrow.gif"> <a href="template.html">Forums</a></span></p>
</div>
<p> </p>
</div>
^ the #navlinks div overflows to the left of the #left div. I don't even know if embedding divs is possible... How can I get it so that I can have multiple divs floated to the right, one on top of the other?
Please help!
- sab
I am using CSS and div tags to create a layout for a webpage.
It is a 3 column layout with a top banner div and a bottom footer div.
My question is, how can I embed the #articlesnav div and the #librarynav div within the #right div, and have them float to the left within that div?
#container
{
width: 90%;
margin: 10px auto;
background-color: #fff;
color: #333;
border: 1px solid gray;
line-height: 130%;
}
body
{
text-align: center;
}
div#container
{
margin-left: 10px auto;
margin-right: 10px auto;
text-align: left;
}
#top
{
padding: .5em;
background-color: #9FA41D;
border-bottom: 1px solid gray;
text-align: left;
}
#top_banner {
float: left;
padding: 0;
text-align: left;
}
#top h1
{
padding: 0;
margin: 0;
}
#left
{
float: left;
width: 160px;
margin: 0;
}
#navlinks {
width: 160px;
float: left;
margin: 0;
padding: 1em;
}
#right
{
width: 160px;
float: right;
margin: 0;
}
#articlesnav
{
float: left;
width:160px;
margin:0;
}
#librarynav {
width:160px;
float: left;
margin:0;
}
#search {
float: right;
width: 160px;
margin: 0;
padding: 1em ;
}
#content
{
margin-left: 200px;
border-left: 1px solid gray;
margin-right: 200px;
border-right: 1px solid gray;
padding: 1em;
}
#footer
{
clear: both;
margin: 0;
padding: .5em;
color: #333;
background-color: #9FA41D;
border-top: 1px solid gray;
}
:confused: When I embed them into the #right div, they are aligned to the right and they flow over the right side of the side, and they have a bit too much margin space to the left... is this the padding of the #right div acting on the embedded divs?
Also, when i do this:
<div id="left">
<div id="navlinks">
<p><span class="navlink"><img src="img/doublerightarrow.gif"> <a href="template.html">Online Library</a></span></p>
<p><span class="navlink"><img src="img/doublerightarrow.gif"> <a href="template.html">Articles</a></span></p>
<p><span class="navlink"><img src="img/doublerightarrow.gif"> <a href="template.html">Forums</a></span></p>
</div>
<p> </p>
</div>
^ the #navlinks div overflows to the left of the #left div. I don't even know if embedding divs is possible... How can I get it so that I can have multiple divs floated to the right, one on top of the other?
Please help!
- sab