css学习之边框样式、外边距合并

边框的样式:

border-style:定义了10个不同的非继承样式,包括none

边框的单边框样式:

border-top-style

border-left-style

border-right-style

border-bottom-style


边框的宽度:

border-width

单边框:

border-top-width

border-left-width

border-right-width

border-bottom-width


边框颜色、边框的单边框颜色:

border-color

border-top-color

border-left-color

border-right-color

border-bottom-color


css3边框:

border-radius:圆角边框

box-shadow:边框阴影

border-image:边框图片


外边距合并:

外边距合并就是一个叠加的概念。

效果图


html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
    <div class="container">
        <div class="bd">
            <div class="pd">
                <div class="content">Hello</div>
            </div>
        </div>
    </div>
    <div class="container1">
        <div class="bd1">
            <div class="pd1">
                <div class="content1">Hello</div>
            </div>
        </div>
    </div>
</body>
</html>
css:

body{
    margin:0;
}
.container{
    margin: 50px;
}
.bd{
    border-style: groove;
}
.pd{
    padding: 10px;
}
.content{
    background-color: blue;
}
.container1{
    margin: 100px;
}
.bd1{
    border-style: groove;
}
.pd1{
    padding: 10px;
}
.content1{
    background-color: blue;
}

div外边距合并的话,如果一个div的外边距是100px;一个外边距是50px;那么最终按照100px来进行合并。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Henry_Jing

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值