一,效果图。

 

【代码笔记】Web-CSS-CSS盒子模型

二,代码。

【代码笔记】Web-CSS-CSS盒子模型
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>CSS 盒子模型</title>
    <style>
    div.ex {
        width: 220px;
        padding: 10px;
        border: 5px solid gray;
        margin: 0px;
    }
    </style>
</head>

<body>
    <img src="w3css.gif" width="250" height="250" />
    <div class="ex">the picture above is 250px wide.the total width of this element is also 250px.</div>
</body>

</html>
【代码笔记】Web-CSS-CSS盒子模型

 

参考资料:《菜鸟教程》

一,效果图。

 

【代码笔记】Web-CSS-CSS盒子模型

二,代码。

【代码笔记】Web-CSS-CSS盒子模型
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>CSS 盒子模型</title>
    <style>
    div.ex {
        width: 220px;
        padding: 10px;
        border: 5px solid gray;
        margin: 0px;
    }
    </style>
</head>

<body>
    <img src="w3css.gif" width="250" height="250" />
    <div class="ex">the picture above is 250px wide.the total width of this element is also 250px.</div>
</body>

</html>
【代码笔记】Web-CSS-CSS盒子模型

 

参考资料:《菜鸟教程》

相关文章:

  • 2021-12-25
  • 2021-05-30
  • 2021-11-30
  • 2021-11-04
猜你喜欢
  • 2021-11-26
  • 2021-08-28
  • 2021-04-21
  • 2022-01-13
  • 2021-08-23
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案