首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > CSS >

CSS分栏有关问题

2012-02-07 
CSS分栏问题css如下:.main {width: 966px margin: 40px auto}.main_picture {}.now {}.home_passage {po

CSS分栏问题
css如下:
.main {width: 966px; margin: 40px auto;}
.main_picture {}
.now {}
.home_passage {position: relative; background-color: #FFFFFF;}
.3_1 {width: 321px; border-right: 1px solid #3c3c3c; background-color:#FFFFFF; float: left;}
.3_2 {width: 321px; border-right: 1px solid #3c3c3c; background-color:#FFFFFF; float: left;}
.3_3 {width: 322px; background-color:#FFFFFF; float: left;}
.space {clear: both;}
.footer {position: relative;}

html如下
<body>
<div class="main">
  <div>jksdjflsdjflkdsjl</div>
  </div>
  <div class="main_picture">
  lksdjflkjsldfjlasdjfljsadf
  </div>
  <div class="now">
  lksadjfljs
  </div>
  <div>
  klsdjflasjdf
  </div>
  <div class="home_passage">
  <div class="3_1">
  jkldsjflsdjflsd
  </div>
  <div class="3_2">
  sdfsdlfkjsdkjf
  </div>
  <div class="3_3">jsldfjldsjflsdf
  </div>
  </div>
  <div class="space">
  </div>
  <div class="footer">
  jlsdfjlsdjflsd
  </div>
</body>
显示时总是不分栏,怎么回事?

[解决办法]
起名字最好起一些稳妥一点的

HTML code
<style>.main {width: 966px; margin: 40px auto;}.main_picture {}.now {}.home_passage {position: relative; background-color: #FFFFFF;}.h3_1 {width: 321px; border-right: 1px solid #3c3c3c; background-color:#FFFFFF; float: left;}.h3_2 {width: 321px; border-right: 1px solid #3c3c3c; background-color:#FFFFFF; float: left;}.h3_3 {width: 322px; background-color:#FFFFFF; float: left;}.space {clear: both;}.footer {position: relative;}</style><body><div class="main">  <div>jksdjflsdjflkdsjl</div>  </div>  <div class="main_picture">  lksdjflkjsldfjlasdjfljsadf  </div>  <div class="now">  lksadjfljs  </div>  <div>  klsdjflasjdf  </div>  <div class="home_passage">  <div class="h3_1">  jkldsjflsdjflsd  </div>  <div class="h3_2">  sdfsdlfkjsdkjf  </div>  <div class="h3_3">jsldfjldsjflsdf  </div>  </div>  <div class="space">  </div>  <div class="footer">  jlsdfjlsdjflsd  </div></body> 

热点排行