编辑下面的代码:【加编码】
<html> <head> <style type="text/css"> div.ex { width:220px; padding:10px; border:5px solid gray; margin:0px; } </style> </head><body> <img src="/demo/250px.gif" width="250" height="1"><br><br> <div class="ex">上面线的宽度为 250px 。<br> 现在本元素的整体宽度也为 250px。</div> <p><b>注意:</b> 在这个例子我们加上了 DOCTYPE 声明(在 html元素前面), 所以它将在任何浏览器中都将正常显示。</p> </body></html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂