Home > Article > Web Front-end > Can you set different widths for columns in CSS3?
Question:
Is it possible to specify different widths for columns in CSS3?
Discussion:
In CSS3, the column-width property sets the width of multiple columns in a multi-column layout. However, you can only define a single value for all columns. This means that every column will have the same width.
Example:
Consider the following HTML markup for a two-column layout:
<code class="html"><div style="-webkit-column-count: 2; -webkit-column-rule: 1px solid black; -webkit-column-width: 80px; margin-left:20px;margin-top:20px;"> <div id="picturebox">picture box</div> <div id="nme">name</div> </div></code>
In this example, both the "picture box" and "name" divs will have the same width of 80px.
Answer:
No, it is not possible to specify different widths for columns in CSS3.
The column-width property is designed for content that flows evenly between equal columns. Assigning different widths to columns would disrupt the flow of the content and create an inconsistent layout.
The above is the detailed content of Can you set different widths for columns in CSS3?. For more information, please follow other related articles on the PHP Chinese website!