


New properties in css3: summary of css3 multi-column layout properties (with examples)
The multi-column layout attribute has been added to css3. What is multi-column layout? The so-called multi-column layout is to create multiple columns to lay out text, similar to the layout of a newspaper. So, in this article we will take a look at some related properties and code examples in multi-column layout.
CSS3 multi-column layout container properties:
column-width: auto | :Define a minimum width for the column (min-width).
auto: Column width is determined by other elements.
length: Explicitly set the minimum width.
column-count: auto | : Define the number of columns.
auto: The element has only one column. It's like there is no setting.
: Positive integer value. The value is an integer greater than 0, and negative values are invalid.
columns: || : is the abbreviation of column-width and column-count. Any order.
Column width = (parent element width - (number of columns-1) column gap) / number of columns*
For example: the parent element is 40em, divided into 4 columns, and the column gap is 2em. Then the column width is (40 - (4-1) * 2) / 4 = 8.5em.
If the explicitly set column width is smaller than this width, it will be displayed with this width.
If the explicitly set column width is larger than this width, it will rearrange the column width and number of columns according to the appropriate size. The currently set column widths and number of columns are not accurate.
column-gap: normal | : Define column spacing. If the value is too large, the layout will be broken.
normal: Default value, parsed by the browser, usually lem.
: A length value consisting of a floating point number and a unit identifier. Such as: 2.1em.
column-rule: | | : Define column borders.
Its centerline is always the same as the centerline of the column spacing. In other words, it is always in the middle of two columns. Similar to border. If the column border is larger than the column spacing, it will not disappear automatically. The portion of the column border that extends beyond the column spacing appears to sink beneath the text (background effect).
column-fill: auto | balance: Define whether the height of each column in multiple columns is uniform.
This attribute is very strange. And it's not uniform across browsers. It has two values: auto | balance. exist The test results in ie10/ie11/opera40/chrome52 are all the same, and it is found that there is no difference between these two properties. When tested in Firefox 49, there is a difference between these two properties. Balance means that the height of each column is almost the same (alignment), and auto automatically merges them into one column, no matter how many columns you set.
css3 multi-column layout item (element) attributes:
column-span: none | all: Define how many columns an element spans.
If we often put the title across all columns. Then, column-span: all. The default value is column-span: none; indicating no spanning of columns.
css3 multi-column layout code:
nbsp;html> <meta> <meta> <meta> <title>多列布局|column-span</title> <style> *{ margin: 0; padding: 0; } .wrapper { width: 40em; margin:0 auto; border: 1px solid #ccc; /*多列布局*/ -moz-column-count: 4; -webkit-column-count: 4; column-count: 4; -moz-column-gap: 2em; -webkit-column-gap: 2em; column-gap: 2em; -moz-column-rule: .1em dashed #ccc; -webkit-column-rule: .1em dashed #ccc; column-rule: .1em dashed #ccc; -webkig-column-fill: balance; -moz-column-fill: balance; column-fill: balance; } h1 { font-size: 1.5em; margin-bottom: 1em; -moz-column-span: all; -webkit-column-span: all; column-span: all; padding-bottom: 5px; text-align: center; border-bottom: 2px solid #ccc; } p { margin-bottom: 1em; text-indent: 2em; line-height: 1.625; font-size: .7em; } </style> <div> <h1 id="为什么您宁愿吃生活的苦-也不愿吃学习的苦">为什么您宁愿吃生活的苦,也不愿吃学习的苦?</h1> <h3 id="一-为什么大多数人宁愿吃生活的苦-也不愿吃学习的苦">一. 为什么大多数人宁愿吃生活的苦,也不愿吃学习的苦?</h3> <p>记得小时候上学,学校每次放月假,爷爷就去车站接我回家。 那时家里离车站远,需要骑着车子来回。 一路上我们彼此相对无语,等到爷爷骑不动了,我们就这么一前一后推着车子走着,记得爷爷常常和我说: “吃得苦中苦,方为人上人,你日后要好生读书。” 那时的我未解其意,只是默默记在心里,望着不远处稻田里的乡亲们弯腰割麦俯首插秧,我觉着他们太辛苦了。 几年过去了,我考入了省城上大学,学了这个城市最热门也最富前景的工程造价专业。 后来,我走进实习单位, 工地的环境有多么糟糕自不必多说,晴天尘土飞扬骄阳似火,雨天泥泞不堪污水四溢。 物质世界的贫瘠尚可以忍受,然而精神世界的荒芜会随着时间慢慢消磨你的梦想和纯真。 后来,我选择去了深圳,在那里我终于找到了自己热爱的行业,眼前陌生的一切都让我感到兴奋和欢愉。 人工智能、自动驾驶、虚拟现实、风投、天使轮这些名词让我看到了世界的另一面。 越是不断地拓宽知识面,越是觉得自己知识储备量的贫瘠与荒凉。</p> <h3 id="二-生活的痛苦使人麻痹-学习的痛苦让人清醒-过去不按思维而生活-终将有一天要按照生活而思维">二. 生活的痛苦使人麻痹,学习的痛苦让人清醒 ;过去不按思维而生活,终将有一天要按照生活而思维</h3> <p>痛苦之所以不被人喜欢,大多数是因为人们从不会思考自己为何痛苦。 然而,这世上还有另一种痛苦是,对这个世界产生了失望的情绪,然后把自己对这个世界的失望,当作是自己本该如此,甚至误以为这就是吃苦的好处。 我总觉得苦难的意义,在于我们更好地去思考人生为何如此苦难,就像有人曾说:未经省察的人生,从不值得一过。 如果没有经过思索和自省,苦难终究只是苦难而已,没有任何意义。 有些人,年轻时总觉得学不学习无关紧要,反正自己体力好得很,只要自己身体好就能混口饭吃。 他们终将会明白,那些为了讨生活不得已而吃的苦,就是当年不吃学习苦的代价。 学习的苦,是枯燥的苦,是短期没有回报的苦,这种苦看得见,摸得着,谁都不愿吃。 生活的苦,是绝望的苦,是长期没有出路的苦,这种苦看不见,摸不着,谁都不想吃。 我从不喜欢自讨苦吃,如果我能通过学习和自我提升避免遇见这些痛苦的经历,我有什么理由不去学习? 生活其实并不苦,苦的是那个不知苦也不知如何避免吃苦的人生。 学习其实并不苦,苦的是早已被生活消磨掉的好奇心和敢于对未来报有期望的勇气。</p> </div>
Running effect:
Recommended related articles:
css3-columns multi-column layout_html/css_WEB-ITnose
##A brief discussion on the new features of CSS3 multi-column layout module
CSS3 Columns is a useful columnar layout
The above is the detailed content of New properties in css3: summary of css3 multi-column layout properties (with examples). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

When developing websites using CraftCMS, you often encounter resource file caching problems, especially when you frequently update CSS and JavaScript files, old versions of files may still be cached by the browser, causing users to not see the latest changes in time. This problem not only affects the user experience, but also increases the difficulty of development and debugging. Recently, I encountered similar troubles in my project, and after some exploration, I found the plugin wiejeben/craft-laravel-mix, which perfectly solved my caching problem.

HTML5 code consists of tags, elements and attributes: 1. The tag defines the content type and is surrounded by angle brackets, such as. 2. Elements are composed of start tags, contents and end tags, such as contents. 3. Attributes define key-value pairs in the start tag, enhance functions, such as. These are the basic units for building web structure.

When developing a new content management system (CMS), I encountered a common but difficult problem: how to quickly build a fully functional CMS without adding too much complexity. There are many ready-made CMS solutions available on the market, but they are often too large and complex to configure and can be a burden for small projects. After some exploration, I discovered the lebenlabs/simplecms library, which provides a simple and efficient solution through Composer.

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

The top ten safe and reliable exchanges in the 2025 cryptocurrency circle include: 1. Binance, 2. OKX, 3. Gate.io (Sesame Open), 4. Coinbase, 5. Kraken, 6. Huobi Global, 7. Gemini, 8. Crypto.com, 9. Bitfinex, 10. KuCoin. These exchanges are rated as safe and reliable based on compliance, technical strength and user feedback.

Using HTML to render components and data in React can be achieved through the following steps: Using JSX syntax: React uses JSX syntax to embed HTML structures into JavaScript code, and operates the DOM after compilation. Components are combined with HTML: React components pass data through props and dynamically generate HTML content, such as. Data flow management: React's data flow is one-way, passed from the parent component to the child component, ensuring that the data flow is controllable, such as App components passing name to Greeting. Basic usage example: Use map function to render a list, you need to add a key attribute, such as rendering a fruit list. Advanced usage example: Use the useState hook to manage state and implement dynamics

Laravel 8 provides the following options for performance optimization: Cache configuration: Use Redis to cache drivers, cache facades, cache views, and page snippets. Database optimization: establish indexing, use query scope, and use Eloquent relationships. JavaScript and CSS optimization: Use version control, merge and shrink assets, use CDN. Code optimization: Use Composer installation package, use Laravel helper functions, and follow PSR standards. Monitoring and analysis: Use Laravel Scout, use Telescope, monitor application metrics.
