您的位置:首页 > Web前端 > CSS

全屏背景、css三角形、自定圆角位置

2017-07-25 23:18 477 查看
<div class="contain">
<div class="triangle">

</div>
<div class="tag">秒退房</div>
</div>


html{
/*background: url('../img/u607.png') no-repeat center center fixed;居中固定背景*/
background: url('../img/u607.png') no-repeat;
background-size: cover;

}
.contain{
height: 1000px;
position: relative;
}
/*三角形*/
.triangle{
position: relative;
top: 120px;
border-color: transparent #DA004C #DA004C transparent;/*注意*/
border-style: solid;
border-width: 20px 20px 20px 20px;/*注意*/
height: 0px;
width: 0px;
}
/*自定义圆角位置*/
.tag{
background: #F29C9F;
position: absolute;
left: 50%;
color: #fff;
transform: translate(-50%,0);
top: 80px;
width: 6rem;
height: 2rem;
line-height: 2rem;
text-align: center;
border-top-right-radius: 5px;/*注意*/
border-top-left-radius: 5px;/*注意*/
border-bottom-left-radius:5px;/*注意*/
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: