1.css实现height:100%后,出现滚动条
{
overflow: hidden;
height: 100%;
display: flex;
}
2.元素右侧增加一些突出样式
html:
<div class="post-flag-container">
<div class="post-flag flag-danger">待处理
</div>
</div>
css:
.post-flag-container {
position:absolute;
top:0;
right:0;
z-index:1;
width:120px;
height:80px;
background:transparent;
overflow:hidden;
}
.post-flag-container .post-flag.flag-info {
background-color:#409eff;
}
.post-flag-container .post-flag.flag-danger {
background-color:rgba(235,0,20,.7);
}
.post-flag-container .post-flag.flag-success {
background-color:#00c796;
}
.post-flag-container .post-flag {
position:relative;
top:15px;
left:30px;
padding:5px 0;
text-align:center;
background-color:rgba(0,153,204,.7);
font-size:12px;
color:#fff;
transform:rotate(45deg);
-webkit-transform:rotate(45deg);
}
效果预览:
3.好看的边框效果
{
background: #ffffff;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
margin-bottom: 0px;
}
效果预览