將圖片或div設(shè)置圓角
/*設(shè)置圓角15為圓角大小,設(shè)50%時(shí)可以變成圓?*/
border-radius: 15px;
背景圖片設(shè)置
/*第一個(gè)參數(shù)是圖片地址,第二個(gè)為圖片顯示方式(no-repeat:平鋪不重復(fù)),顯示位置居中*/
background: url(../images/daohang.png) no-repeat center;
/*第一個(gè)參數(shù)是圖片地址,第二個(gè)為圖片顯示方式(no-repeat:平鋪不重復(fù)),顯示位置(x軸位置,y軸位置)可以百分比也可以像素*/
background: url(../images/daohang.png) no-repeat 50px 30px;
background: url(../images/daohang.png) no-repeat 50% 30%;
/*背景圖片大小*/
background-size: 100% 100%;
超出一行變成省略號(hào)
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
//控制行數(shù)
-webkit-line-clamp:1;
-webkit-box-orient:vertical;
使用偽類(lèi)設(shè)置下劃線
.classify-title {
position: relative;
width: 100%;
height: 30px;
line-height: 25px;
font-weight: 600;
font-size: 16px;
}
.classify-title:before {
content: '';
position: absolute;
left: 0;
top: auto;
bottom: 1px;
right: 0;
height: 5px;
width: 30px;
background-color: #f39c81;
}
圖片水平居中垂直居中
.graphic-module_image-module {
display: -webkit-box;
-webkit-box-align: center;
-webkit-box-pack: center;
}
.graphic-module_image-module image {
width: 60px;
height: 60px;
}
display: flex;超出自動(dòng)換行
.icon-choose {
display: flex;
width: 100%;
height: auto;
flex-wrap: wrap;
}
.icon-choose_bn-module {
padding: 5px 0;
width: 25%;
text-align: center;
}
div 自動(dòng)換行
word-break: break-all;
text-indent抬頭距離,letter-spacing字與字間距。
//兩個(gè)字體的縮進(jìn)
text-indent:2em;
//20px的縮進(jìn)
text-indent:20px;
文字陰影
text-shadow:5px 5px 5px