首页 > 开发 > CSS > 正文

让多个div在同一行显示的样式及html代码

2024-07-11 08:39:35
字体:
来源:转载
供稿:网友

以下为css样式:


div{
margin-bottom: 10px;
clear:both;
word-break:break-all;
word-wrap:break-word;
}


<pre name=”code” class=”css”><!–width指定每个div占据的宽度–></pre>.custom_div{height: 23px;width: 50px;line-height: 23px;float: left;}
<pre></pre>

以下为html代码:
[code]<pre name=”code” class=”html”>
<div id=”pid”>
<div id=”d1″ class=”custom_div”>jelly1</div>
<div id=”d2″ class=”custom_div”>jelly2</div>
<div id=”d3″ class=”custom_div”>jelly3</div>
</div></pre>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表