问题
Am new to html and css I want to build a page with 3layouts right side left side and middle part will be content My question is how to place a divs on right and left side I tried APdiv in dreamweaver but it is overlaping plz give me a solution
回答1:
Use
float:left;
for left,
float:right;
for right. And search before, ask you can find easily this questions answer on the net.
回答2:
This is one way of doing 3 column web page:
HTML:
...
<body>
<div id="container">
<div id="left">LEFT</div>
<div id="center">CENTER</div>
<div id="right">RIGHT</div>
</div>
</body>
...
CSS:
#container{
width: 960px;
margin: 0 auto;
overflow: hidden; /* This is not to overlap */
}
#left{
width: 200px;
height: 800px;
background-color: red;
float: left;
}
#center{
width: 560px;
height: 800px;
background-color: blue;
float: left;
}
#right{
width: 200px;
height: 800px;
background-color: green;
float: left; /* you can do here float:right also */
}
来源:https://stackoverflow.com/questions/25594703/div-positioning-on-right-and-left-side