如何让相同样式的层并列

zt715 2009-12-25 02:18:43
我的意思是有多个div
其中一个div为content,其他的是子层,但样式表相同,不过想将它并列排列,改如何做,我写的代码如下:

<style type="text/css">
<!--
#indexHousePic {
position:absolute;
width:675px;
height:200px;
}
.ShowHousePic {
position:absolute;
width:25%;
height:200px;
float:left;
}
-->
</style>



<div id="indexHousePic" align="center">
<div class="ShowHousePic">test</div><div class="ShowHousePic">123</div>
<div class="ShowHousePic">14</div>
<div class="ShowHousePic">4124</div>
</div>

我想将那4个div并列排列,改如何设置css?
...全文
49 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
夜雨_Jason 2009-12-25
  • 打赏
  • 举报
回复

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
#indexHousePic {
position:absolute;
width:676px;
height:200px;
text-align:center;
}
.ShowHousePic {
width:25%;
height:200px;
float:left;
display:inline;
overflow:hidden;
}
-->
</style>
<script type="text/javascript">


</script>
</head>

<body>
<div id="indexHousePic">
<div class="ShowHousePic">test </div>
<div class="ShowHousePic">123 </div>
<div class="ShowHousePic">14 </div>
<div class="ShowHousePic">4124 </div>
</div>
</body>
</html>
浪尖赏花 2009-12-25
  • 打赏
  • 举报
回复
.ShowHousePic {
display:inline;
width:24%;
height:200px;
float:left;
}

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧