Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

[已答复] 怎么把ss分两栏?

[复制链接]
iart 发表于 2007-4-8 18:42:17 | 显示全部楼层 |阅读模式
喜欢简洁一点的,又定义了div透明等等,不想转表格,ss该怎么改两栏呢
回复

使用道具 举报

csy0517 发表于 2009-7-27 23:38:40 | 显示全部楼层
我也想知道呢
回复

使用道具 举报

littlehz 发表于 2009-7-28 00:14:12 | 显示全部楼层
举例层级DIV。在HTML中

  1. <div id="mian">
  2.     <div id="left">左侧内容</div>
  3.     <div id="right">右侧内容</div>
  4. </div>
复制代码
CSS中这样写

  1. #main { width:600px; clear:both; background:#DEF;}
  2. #left { width:300px; height:100px; float:left; background:#9AF;}
  3. #right { width:250px; margin:0 0 0 10px; height:100px; float:left; background:#D7A;}
复制代码
div并排的关键在于外层容器main,定义的宽度比内层容器宽度之和加上margin外补丁的间隙 还要大。内层两个容器都设置float。

参阅http://www.w3school.com.cn/css
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-9-12 06:07 , Processed in 0.083945 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表