简体   繁体   中英

DIV POSITIONING on right and left side

html和css的新手,我想构建一个页面,其中右侧和左侧和中间部分均具有3layouts。我的问题是如何在Dreamweaver中尝试过APdiv的右侧和左侧放置div,但重叠的按钮给了我解

Use

float:left;

for left,

float:right;

for right. And search before, ask you can find easily this questions answer on the net.

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 */
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM