1. Add a comment block at the beginning of the style sheet to describe the creation date, creator, tags and other notes of the style sheet. Copy code The code is as follows:Example Source Code: /* --------------------------------- Site: Site name Author: 52CSS.com Updated: Date and time Updated by: Name --------------------------------- */ 2. Including public color marking Copy code The code is as follows:Example Source Code: /* --------------------------------- COLORS Body background: #def455 Container background: #fff Main Text: #333 Links: #00600f Visited links: #098761 Hover links: #aaf433 H1, H2, H3: #960 H4, H5, H6: #000 --------------------------------- */ 3. Give ID and Class meaningful names <br />Not recommended naming method: Example Source Code: Copy code The code is as follows:.green-box { ... } #big-text { ... } Recommended naming convention: Example Source Code: Copy code The code is as follows:.pullquote { ... } #introduction {... } 4. Integrate related style rules Example Source Code: Copy code The code is as follows:#header { ... } #header h1 { ... } #header h1 img { ... } #header form { ... } #header a#skip { ... } #navigation { ... } #navigation ul { ... } #navigation ul li { ... } #navigation ul li a { ... } #navigation ul li a:hover { ... } #content { ... } #content h2 { ... } #content p { ... } #content ul { ... } #content ul li { ... } 5. Add clear comments to styles Example Source Code: Copy code The code is as follows:/* --------------------------------- Header styles --------------------------------- */ #header { ... } #header h1 { ... } #header h1 img { ... } #header form { ... } /* --------------------------------- navigation styles --------------------------------- */ #navigation { ... } |
<<: JS ES new feature of variable decoupling assignment
>>: HTML form value transfer example through get method
Table of contents 1. Installation 2. Introduction...
Write at the beginning This article only covers E...
The development of Docker technology provides a m...
1. The mysqldump backup method uses logical backu...
This article shares the specific code of jQuery t...
After the previous two chapters, do you have a ne...
Table of contents 1. World Map 1. Install openlay...
I'm playing with big data recently. A friend ...
Table of contents Require Implementation Code dat...
Table of contents Preface Simulating data Merged ...
This article shares the specific code for the WeC...
This article will introduce some commonly used ar...
Pure js implements a single-click editable table ...
Since enabling https access for the entire site, ...
Using the <img> element with the default sr...