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 */