class样式命名

常见class关键词:

  • 布局类:header, footer, container, main, content, aside, page, section
  • 包裹类:wrap, inner
  • 区块类:region, block, box
  • 结构类:hd, bd, ft, top, bottom, left, right, middle, col, row, grid, span
  • 列表类:list, item, field
  • 主次类:primary, secondary, sub, minor
  • 大小类:s, m, l, xl, large, small
  • 状态类:active, current, checked, hover, fail, success, warn, error, on, off
  • 导航类:nav, prev, next, breadcrumb, forward, back, indicator, paging, first, last
  • 交互类:tips, alert, modal, pop, panel, tabs, accordion, slide, scroll, overlay,
  • 星级类:rate, star
  • 分割类:group, seperate, divider
  • 等分类:full, half, third, quarter
  • 表格类:table, tr, td, cell, row
  • 图片类:img, thumbnail, original, album, gallery
  • 语言类:cn, en
  • 论坛类:forum, bbs, topic, post
  • 方向类:up, down, left, right
  • 其他语义类:btn, close, ok, cancel, switch; link, title, info, intro, more, icon; form, label, search, contact, phone, date, email, user; view, loading…
  • 例如:text改为txt、delete改为del,这里针对单个单词组合命名,对词组单词的组合建议不使用缩写或简写。
class类名类名缩写
bottombtm
buttonbtn
backgroundbg
contentcont
checkchk
currentcurr
deletedel
texttxt
disableddis
footft
headhd
hiddenhide
inputinp
imageimg
indexidx
radiorad
registerreg
selectsel
tbodytbd
theadthd
tfoottft
wrapwp

各版本浏览器Hack

.all-IE{property: value\9;}
.IE-9{property: value\0/;}
.gte-IE-8{property: value\0/;}
.lte-IE-8{*property:value;}
.IE-7{+property:value;}
.IE-6{_property:value;}
/** Firefox浏览器 **/
@-moz-document url-prefix()  {
    .firefox{property:value;}
 }
/** Opera浏览器 **/
@media all and (-webkit-min-device-pixel-ratio: 0) {
    .webkit{property:value;}
}
@media all and (-webkit-min-device-pixel-ratio: 10000), not all and (-webkit-min-device-pixel-ratio: 0) {
    .opera{property:value;}
}
/** Webkit内核浏览器(Safari、Chrome) **/
@media screen and (max-device-width: 480px) {
    .iphone-webkit{property:value;
}

前端工程师基本套路
在这里插入图片描述
转自:class命名
class命名

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值