如何遵循CSS命名规范,并注意书写细节?

2026-04-02 02:370阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计1736个文字,预计阅读时间需要7分钟。

如何遵循CSS命名规范,并注意书写细节?

CSS 书写顺序:

* 属性:display, position, float, clear, cursor 等* 盒模型:margin, padding, width, height* 排版:vertical-align, white-space, text-decoration, text-align 等* 文字:color, font, content* 边框和背景:border, background* 为什么:为了提高代码的可读性和维护性


CSS书写顺序

*{

/*显示属性*/

display

position

float

clear

cursor

/*盒模型*/

margin

padding

width

height

/*排版*/

vertical-align

white-space

text-decoration

text-align

/*文字*/

color

font

content

/*边框背景 为什么要把 boder和background放在最后的原因是修改的频率会较之前的频繁,放在最后查看起来方便,哈哈。

阅读全文

本文共计1736个文字,预计阅读时间需要7分钟。

如何遵循CSS命名规范,并注意书写细节?

CSS 书写顺序:

* 属性:display, position, float, clear, cursor 等* 盒模型:margin, padding, width, height* 排版:vertical-align, white-space, text-decoration, text-align 等* 文字:color, font, content* 边框和背景:border, background* 为什么:为了提高代码的可读性和维护性


CSS书写顺序

*{

/*显示属性*/

display

position

float

clear

cursor

/*盒模型*/

margin

padding

width

height

/*排版*/

vertical-align

white-space

text-decoration

text-align

/*文字*/

color

font

content

/*边框背景 为什么要把 boder和background放在最后的原因是修改的频率会较之前的频繁,放在最后查看起来方便,哈哈。

阅读全文