DIV POSITIONING on right and left side

不打扰是莪最后的温柔 提交于 2019-12-11 07:58:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!