css样式表的先后顺序_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 08:54:13
Original
1037 people have browsed it

CSS书写顺序

  1. 位置属性(position, top, right, z-index, display, float等)

  2. 大小(width, height, padding, margin)

  3. 文字系列(font, line-height, letter-spacing, color- text-align等)

  4. 背景(background, border等)

  5. 其他(animation, transition等)


使用CSS缩写属性

  CSS有些属性是可以缩写的,比如padding,margin,font等等,这样精简代码同时又能提高用户的阅读体验。

        去掉小数点前的“0”


连字符CSS选择器命名规范

  1.长名称或词组可以使用中横线来为选择器命名。

  2.不建议使用“_”下划线来命名CSS选择器,为什么呢?

  输入的时候少按一个shift键;

  浏览器兼容问题 (比如使用_tips的选择器命名,在IE6是无效的)

  能良好区分JavaScript变量命名(JS变量命名是用“_”)


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!