In CSS3, multi-column layout columns are used to set the width and number of columns of each column of the object. This property is a shorthand property. The first parameter sets the width of the element column, and the second parameter sets the element's width. The number of columns, the syntax is "columns: column-width column-count;".
The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.
The columns attribute is a shorthand attribute used to set the column width and number of columns.
The syntax is:
columns: column-width column-count;
column-width The width of the column.
column-count Number of columns.
Set or retrieve the number of columns and the width of each column of the object
The example is as follows:
<html> <head> <meta charset="utf-8"> <title>123</title> <style> .newspaper { columns:100px 3; -webkit-columns:100px 3; /* Safari and Chrome */ -moz-columns:100px 3; /* Firefox */ } </style> </head> <body> <p><strong>注意:</strong> columns属性不支持 Internet Explorer 9以及更早版本的浏览器.</p> <div class="newspaper"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. </div> </body> </html>
Output result:
(Learning video sharing: css video tutorial)
The above is the detailed content of What is the usage of css3 multi-column layout columns?. For more information, please follow other related articles on the PHP Chinese website!