CSS(cascading style sheet)層疊樣式表佈局
經常使用樣式總結:flex
white-space: nowrap;/* 不換行 */ overflow-x: hidden; text-overflow:ellipsis;/* 隱藏部分加省略號 */ word-wrap: normal;
.container { display:table;/* 外層容器 */ } .content { display:table-cell; /* 內層文本 */ vertical-align:middle; }
vertical-align:bottom;/* 默認 */
vertical-align:top;
vertical-align:middle;
vertical-align:10px;
vertical-align:-10px;
.clearfix::after { content: ""; display: block; clear: both; }
background-color: #fff;
background-image: url(/img/bg.png);
background-repeat:no-repeat;
background-attachment: fixed;/* fixed:背景圖片固定在視口,不滾動;scroll:默認值,背景repeat並滾動 */
background-position:center center;/* x | y; 能夠是百分數,像素值,left,right | bottom,top, */
background-size: 100% 100%;/* 值能夠是:百分數,像素值,另外,cover:圖片佔滿整個盒子,縮放窗口時切掉多餘的部分,圖片不變形;contain:圖片在盒子內部完整呈現,只按照原比例調整大小,但盒子不必定佔滿 */
box-sizing: content-box;/* 默認值,標準盒模型,width、height的值只包括內容,不包括邊框border、內邊距padding、外邊距margin */
box-sizing: border-box;/* 怪異盒模型,設置的width、height的值包括內容、內邊距padding和邊框,但不包括外邊距margin */