ASTP001
08-03-2011, 04:14 AM
Hi,
I'm trying to edit this website, and I've looked up online tutorials, and have been trying to create a 2 column layout. I was looking at several websites, and it seemed to me that if I have two <div> tag and use css to put them to left and right, they will appear alongside each other as shown in this website: http://www.barelyfitz.com/screencast/html-training/css/positioning/.
My problem is that no matter what I do, the left navigation bar that I made and the content column will never appear side by side, the content colum will always appear at the bottom.
What can I do to fix this?
the code looks like this:
<div class"acctbody">
<div class="cpn">
<ul class="cp_nav">
<li><a href="page1.php">page 1</a></li>
<li><a href="page2.php">page 2</a></li>
</ul>
</div>
<div class="cpc">
content...
</div>
</div>
and the css looks like this
.acctbody{
text-align:center;
padding:3%;
background-color:#ffffff;
}
.cpn{
position: relative;
width : 180px;
left: 0;
margin-left : 1px;
margin-top : 1px;
color : #000000;
padding : 0;
}
.cpn ul {margin:0px; padding:0px;}
.cpn li {list-style: none;}
ul.cp_nav {background:#666;}
ul.cp_nav li {
border-bottom: #fff solid;
border-top: #fff solid;
border-width: 1px;
}
.cpn a {
color: #fff;
cursor: pointer;
display:block;
height:25px;
line-height: 25px;
text-indent: 10px;
text-decoration:none;
width:100%;
}
.cpc{
position:relative;
top:1px;
right: 0;
bottom: 250px;
width:200px;
background-color : #0ffff0;
}
I'm trying to edit this website, and I've looked up online tutorials, and have been trying to create a 2 column layout. I was looking at several websites, and it seemed to me that if I have two <div> tag and use css to put them to left and right, they will appear alongside each other as shown in this website: http://www.barelyfitz.com/screencast/html-training/css/positioning/.
My problem is that no matter what I do, the left navigation bar that I made and the content column will never appear side by side, the content colum will always appear at the bottom.
What can I do to fix this?
the code looks like this:
<div class"acctbody">
<div class="cpn">
<ul class="cp_nav">
<li><a href="page1.php">page 1</a></li>
<li><a href="page2.php">page 2</a></li>
</ul>
</div>
<div class="cpc">
content...
</div>
</div>
and the css looks like this
.acctbody{
text-align:center;
padding:3%;
background-color:#ffffff;
}
.cpn{
position: relative;
width : 180px;
left: 0;
margin-left : 1px;
margin-top : 1px;
color : #000000;
padding : 0;
}
.cpn ul {margin:0px; padding:0px;}
.cpn li {list-style: none;}
ul.cp_nav {background:#666;}
ul.cp_nav li {
border-bottom: #fff solid;
border-top: #fff solid;
border-width: 1px;
}
.cpn a {
color: #fff;
cursor: pointer;
display:block;
height:25px;
line-height: 25px;
text-indent: 10px;
text-decoration:none;
width:100%;
}
.cpc{
position:relative;
top:1px;
right: 0;
bottom: 250px;
width:200px;
background-color : #0ffff0;
}