Blogger Information
Blog 32
fans 0
comment 0
visits 23823
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
盒子模型-2019年4月24日9点30分
小李广花荣
Original
605 people have browsed it

1、下面代码将要展示一个简单的盒子模型代码

实例

.box1{
    width: 200px;
    height: 200px;
    background-color: #0000FF;
    padding: 20px 20px 30px 50px;
    border: 1px solid salmon;
}
.box2{
    width: 100px;
    height: inherit;
    background-color: #0F0F0F;
    padding: 10px;
    border: #00CC66 1px solid;
}

运行实例 »

点击 "运行实例" 按钮查看在线实例

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>盒模型简单案例</title>
    <link rel="stylesheet" href="hz.css">
</head>
<body>
<div class="box1">
    <div class="box2"></div>
</div>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

上述代码 我运用了外联样式表,后期便于操作和维护

2、下面是运行后的样式图

QQ图片20190425194140.png

3、通过上述代码的学习,我学习到了盒子模型中基本的结构

    margin  外边距

    border边框

    padding 内边距

    content 内容

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post