div也是块级元素,能来个例子看下么?
div is also a block-level element. Can you give me an example? -PHP Chinese website Q&A-div is also a block-level element. Can you give me an example? -PHP Chinese website Q&A
Let’s take a look and learn.
我们来写一个div标签,然后写点样式,首先我们要知道,每个块级元素都从新的一行开始,并且其后的元素也另起一行
<div class="dv1"></div>
<div class="dv2"></div>
我们设置这俩个div的宽高和一个边框线就能明白了,是在俩行展示
.dv1{width:200px;height:200px;border:1px solid red;}
.dv2{width:200px;height:200px;border:1px solid green;}
div is also a block-level element. Can you give me an example? -PHP Chinese website Q&A-div is also a block-level element. Can you give me an example? -PHP Chinese website Q&A
Let’s take a look and learn.
我们来写一个div标签,然后写点样式,首先我们要知道,每个块级元素都从新的一行开始,并且其后的元素也另起一行
<div class="dv1"></div>
<div class="dv2"></div>
我们设置这俩个div的宽高和一个边框线就能明白了,是在俩行展示
.dv1{width:200px;height:200px;border:1px solid red;}
.dv2{width:200px;height:200px;border:1px solid green;}