html中div标签怎么用?

div现在一般网页的布局都是使用的div+css来布局,div的话,就是通过。

<div>

<div><p></p></div>

</div>

div的嵌套使用来完成整个网页的布局,你可以将div理解成一个一个的块,然后在div块中写入P等等标签,然后再通过CSS来修饰就行了,如高度,宽度,背景。

<div style="background:#f90; text-align:center;">test</div>

<div style="background:#f60"><span>usemen:</span><input type="text" style="border:1px solid #ccc; 200px; height:20px;" ></div>

<div style="background:#f60"><span>usemen:</span><input type="text" style="border:1px solid #ccc; 200px; height:20px;" ></div>

原文地址:https://www.cnblogs.com/tasunny/p/9820585.html