MattDavid.Hall
23rd September 06, 01:43 AM
Hello everyone!
I have a quick question regarding a layout issue that I am having. I need to have 4 columns for my page layout.
Here is my current CSS code:
#col1
{
float: left;
width: 130px;
margin-left: 0%;
display: inline;
background-color: #5c895c;
}
#col2
{
float: left;
width: 1%;
margin-left: 0%;
background-color: #779b77;
}
#col3
{
float: left;
width: 99%;
margin-left: 0%;
background-color: #ffffe0;
}
#col4
{
float: left;
width: 30px;
margin-left: 0%;
background-color: #e6e6b8;
right: 0px;
}
As you can see I have four columns. 2 are fixed width, the other two are %'s.
I then simply use this HTML code:
<div id="col1"> </div>
<div id="col2"> </div>
<div id="col3"> </div>
<div id="col4"> </div>
The problem I have is that the columns end up using two lines of the page instead of 100%. If I use just HTML tables this works fine. I am still new to CSS layouts so I cannot seem to figure this out. It is probably an easy solution, but I am missing it; even after a couple of hours of browsing the web.
If someone could point me in the direction I need to go I would appreciate it. Thank you in advance!
I have a quick question regarding a layout issue that I am having. I need to have 4 columns for my page layout.
Here is my current CSS code:
#col1
{
float: left;
width: 130px;
margin-left: 0%;
display: inline;
background-color: #5c895c;
}
#col2
{
float: left;
width: 1%;
margin-left: 0%;
background-color: #779b77;
}
#col3
{
float: left;
width: 99%;
margin-left: 0%;
background-color: #ffffe0;
}
#col4
{
float: left;
width: 30px;
margin-left: 0%;
background-color: #e6e6b8;
right: 0px;
}
As you can see I have four columns. 2 are fixed width, the other two are %'s.
I then simply use this HTML code:
<div id="col1"> </div>
<div id="col2"> </div>
<div id="col3"> </div>
<div id="col4"> </div>
The problem I have is that the columns end up using two lines of the page instead of 100%. If I use just HTML tables this works fine. I am still new to CSS layouts so I cannot seem to figure this out. It is probably an easy solution, but I am missing it; even after a couple of hours of browsing the web.
If someone could point me in the direction I need to go I would appreciate it. Thank you in advance!