- Mastering CSS
- Rich Finelli
- 73字
- 2021-07-08 09:45:57
Targeting .column using a pseudo class
Adding the .column:first-child selector will target the first appearance of the column element. We'll add margin-left as zero. When we save this, we get three equal columns with a margin-left for each of them, except the first:
.column:first-child { margin-left: 0; }
Following is the output of preceding code block:

This technique would work just as well with two columns, four columns, or any number of columns.
推薦閱讀
- Visual Basic程序開發(學習筆記)
- Apache Spark 2.x Machine Learning Cookbook
- SQL Server 2012數據庫技術及應用(微課版·第5版)
- ASP.NET Core 2 and Vue.js
- RTC程序設計:實時音視頻權威指南
- Learning SQLite for iOS
- 云原生Spring實戰
- 人人都懂設計模式:從生活中領悟設計模式(Python實現)
- OpenShift在企業中的實踐:PaaS DevOps微服務(第2版)
- Python漫游數學王國:高等數學、線性代數、數理統計及運籌學
- Rust Essentials(Second Edition)
- Unity Game Development Scripting
- 劍指Java:核心原理與應用實踐
- RISC-V體系結構編程與實踐(第2版)
- Nginx實戰:基于Lua語言的配置、開發與架構詳解