昨天复习了flex布局,今天打算继续,才发现有display:table,今天有的点,别的先写上,其他的后补吧
css display
1 // none 此元素不会被显示。 2 // block 此元素将显示为块级元素,此元素前后会带有换行符。 3 // inline 默认。此元素会被显示为内联元素,元素前后没有换行符。 4 // inline-block 行内块元素。(CSS2.1 新增的值) 5 // list-item 此元素会作为列表显示。单独使用会将元素变成块元素 6 // inherit 规定应该从父元素继承 display 属性的值。 7 // run-in 此元素会根据上下文作为块级元素或内联元素显示。 8 //★兼容问题现在还未普及,放弃研究,可以用 vertical-align 替代 9 //参考:http://www.zhangxinxu.com/wordpress/2012/03/tip-css-multiline-display/ 10 // https://q.cnblogs.com/q/67758/ 11 // https://css-tricks.com/run-in/ 12 13 14 //table这的抛砖引玉吧,今天特懒,留着记录吧 15 //参考 16 //http://www.zhangxinxu.com/wordpress/2010/10/%E6%88%91%E6%89%80%E7%9F%A5%E9%81%93%E7%9A%84%E5%87%A0%E7%A7%8Ddisplaytable-cell%E7%9A%84%E5%BA%94%E7%94%A8/ 17 //http://www.jianshu.com/p/700ede25d0bc 18 //https://www.cnblogs.com/guoyong-feng/p/6076058.html 19 20 21 // table 此元素会作为块级表格来显示(类似 <table>),表格前后带有换行符。 22 // inline-table 此元素会作为内联表格来显示(类似 <table>),表格前后没有换行符。 23 // table-row-group 此元素会作为一个或多个行的分组来显示(类似 <tbody>)。 24 // table-header-group 此元素会作为一个或多个行的分组来显示(类似 <thead>)。 25 // table-footer-group 此元素会作为一个或多个行的分组来显示(类似 <tfoot>)。 26 // table-row 此元素会作为一个表格行显示(类似 <tr>)。 27 // table-column-group 此元素会作为一个或多个列的分组来显示(类似 <colgroup>)。 28 // table-column 此元素会作为一个单元格列显示(类似 <col>) 29 // table-cell 此元素会作为一个表格单元格显示(类似 <td> 和 <th>) 30 // table-caption 此元素会作为一个表格标题显示(类似 <caption>)
简单试 list-item 和 inherit
1 <!--display:list-item--> 2 <!--还可以使用list-style--> 3 <span style="display:list-item;list-style: square inside">aaaa</span> 4 <span style="display:list-item;">bbbb</span> 5 <span style="list-style: square inside">这个就不能用list-style</span> 6 <span style="display:list-item;list-style: square inside">dddd</span> 7 8 <!--display:inherit--> 9 <span> 10 父span 11 <div style="display:inherit"> 12 div 13 </div> 14 </span>
这里的 list-style 以前也不知道今天补习吧
1 //顺便补充list-style 2 //有4个属性值 3 //list-style-type //参考http://www.runoob.com/cssref/pr-list-style-type.html 4 //list-style-position //inside outside(默认) 5 //list-style-image //可用url(" ")传址 6 //inherit //ie8及+