css权值和优先级+命名规范

选择器权值:

标签选择器:1

类选择器和伪类选择器:10

ID选择器:100

通配符选择器:0

行内样式:1000

!important 在一定条件下,优先级最高


常用的css样式命名

页面结构
页头:header
页面主体:main
页尾:footer
内容:content/container
容器: container

导航:nav
侧栏:sidebar
栏目:column
页面外围控制:wrapper
左右中:left right center

导航
导航:nav
主导航:mainnav
子导航:subnav
顶导航:topnav
边导航:sidebar

左导航:leftsidebar
右导航:rightsidebar
菜单:menu
子菜单:submenu
标题: title
摘要: summary

功能
标志:logo
广告:banner
登陆:login
登录条:loginbar

注册:register
搜索:search
功能区:shop
标题:title

猜你喜欢

转载自www.cnblogs.com/chenyingying0/p/12244966.html