css疑難
table
跨行 colspan=“3“
跨列 rowspan
標題 <caption align="top">我是表格標題</caption>
display:table-header-group 指定為表格標題
display:table-row-group
文本
單詞換行
word-wrap:break-word // 單詞換行
word-break: break-all // 單詞內換行
css ****奇技淫巧
user-select:none; 禁止頁面元素選中
list-item
[1]不設置寬度時,寬度撐滿一行
[2]獨占一行
[3]支持寬高
run-in
run-in是一個有意思的塊/行內元素混合,可以使某些塊級元素成為下一個元素的行內部分。如果一個元素生成run-in框,而且該框后面是一個塊級框,那么該run-in元素將成為塊級框開始處的一個行內框,run-in框格式化成另一個元素中的行內框,但它們仍從文檔中的父元素繼承屬性
[注意]只有safari和IE8+支持
<h3 style="display:run-in">run-in test</h3>
<p>paragraph</p>
若run-in框后面不是塊級框時,run-in框本身將成為塊級框
<span style="display:run-in">run-in test</span>
<span>paragraph</span>
表格類元素
table{display: table;}
thead{display: table-header-group;}
tbody{display: table-row-group;}
tfoot{display: table-footer-group;}
tr{display: table-row;}
td,th{display: table-cell;}
col{display: table-column;}
colgroup{display: table-column-group;}
caption{display: table-caption;}
table
【特征】
[1]不設置寬度時,寬度由內容撐開
[2]獨占一行
[3]支持寬高
[4]默認具有表格特征,可設置table-layout、border-collapse、border-spacing等表格專有屬性
inline-table
【特征】
[1]不設置寬度時,寬度由內容撐開
[2]非獨占一行
[3]支持寬高
[4]默認具有表格特征,可設置table-layout、border-collapse、border-spacing等表格專有屬性
table-cell
【特征】
[1]不設置寬度時,寬度由內容撐開
[2]非獨占一行
[3]支持寬高
[4]垂直對齊
[5]同級等高
table-caption
【特征】
[1]不設置寬度時,寬度由內容撐開
[2]獨占一行
[3]支持寬高
注意事項
【1】如果一個元素是絕對定位元素,float的值設置為none,對于浮動元素或絕對定位元素,計算值由聲明值確定
【2】對于根元素,如果聲明為值inline-table或table,都會得到計算值table,聲明為none時則會得到同樣的計算值none,所有其他display值都計算為block
好的