border-style:dotted solid double dashed;
dotted :上边框是点状
solid:右边框是实线
double:下边框是双线
dashed:左边框是虚线
.flex布局
<div class= "flex"></div>
<style>
.flex{
display:flex;
align-items: center; /*垂直方向居中*/
justify-content: center; /*水平方向居中*/
}
</style>
父元素标签,里面加一个子元素可居中显示
margin 负值居中
<div class="box"></div>
#css
.box{
width:200px;
height: 200px;
position: absolute;
left:50%;
top:50%;
margin-left:-100px;
margin-top:-100px;
}
absolute 绝对定位
<div class="box"></div>
#css
.box{
position:absolute/fixed;
left:0;
right:0;
top:0;
bottom:0;
margin:auto;
}
现在最好用的就是flex布局。要熟练
div画三角形
<!DOCTYPE >
<thml>
<style>
.d4{
margin-left: 110px;
float: left;
width: 0;
height: 0;
border-width: 100px;
border-style: solid;
border-color: transparent #0099CC transparent transparent;
}
/**html*/
</style>
</thml>
<body>
<div class="d4"></div>
</body>