属性 | 问题 | 解决方案 | |
---|---|---|---|
hspace vspace | 实现文字环绕图片布局 | <img src="" width="120" hspace="5" vspace="5"> | |
font | 简化css | font:italic small-caps(全大写) bold 12px/1.5em "宋体" 有字号、行间距、中文字体、英文字体 | |
table | td th 宽度设置无效 | table 设置 table-layout: fixed 样式 | |
word-break | 文字换行 | normal | 使用浏览器默认的换行规则。 |
break-all | 允许在单词内换行。 | ||
keep-all | 只能在半角空格或连字符处换行。 | ||
超出省略号 |
| ||
-webkit-box | 多行文本溢出显示省略号 | | |
text-transform | 大写 | uppercase | |
小写 | /lowercase | ||
text-align | 文字左右对齐 | text-align: justify | |
文字左右对齐 | text-align-last: justify | ||
垂直居中 | table-cell 配合 vertical-align | display: table-cell; vertical-align:middle; | |
absolute 配合 tranform | position:absolute; top: 50%; transform: translateY(-50%); | ||
选择器 | first-child | 首个 | |
nth-of-type | (odd) 偶数个 | ||
(event) 奇数个 |