首页 > 编程知识 正文

html中各种标签,css position属性

时间:2023-05-03 05:15:32 阅读:57823 作者:2208

月关宝箱

据我所知,css中没有colspan,但column-span在不久的将来会有多列布局,但只是CSS3的草案,所以可以在这里确认。 无论如何,您都可以使用类似于div和span的表格显示来创建解决方案。 这将是HTML :

forthesakeoftable-less layout.* /

. table{display:table; 表层布局:固定; width:100px; }

. row{display:table-row; height:10px; }

. cell{display:table-cell; }

/* thisiswherethecolspantricksworks.* /

span{width:100%; }

/* belowisforvisualrecognitiontestpurposesonly.* /

. red{background:red; }

. blue{background:blue; }

. green{background:green; }

.黑屏{ background :黑屏; }

/* thisisthebenefitofusingtabledisplay,itisable

tosetthewidthofit ' schildobjecttofilltherestof

theparentwidthasintable*/

. first{width:20px; }

. last{width:30px; }

. fill{width:100%; }使用此技术的唯一原因是为了受益于table-layout行为。 如果仅将div和span的宽度设置为恒定的百分比不满足设计要求,请使用它。 但是,如果不需要从这种table-layout行为中受益的话,durilai的回答就足够了。

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。