codecamp

CSS属性取值规范

CSS属性取值规范

字体大小font-size

font-size目前人人CSS取值的几种类型如下:

1
12px/9pt/1.2em/150%/1.7

现将font-size取值的单位类型约束如下:

  1. 1、font-size必须以px或pt为单位,推荐用px(注:pt为打印版字体大小设置)

  2. 2、不允许使用xx-small/x-small/small/medium/large/x-large/xx-large等值

字体系列font-family

目前font-family取值类型丰富多样,比如home-frame2-all-min.css中:

bodyTahoma, Verdana, STHeiTi, simsun, sans-serif
.fselect-pager li aArial
a.mini-sharemingliu
.smalltahoma, mingliu
select, label, textarea, input“lucida grande”, tahoma, verdana, arial, STHeiTi, simsun, sans-serif
.m-autosug smallMingLiU
#appsMenuPro .menu-apps-side a.add-app-btn宋体
.site-footer .haoestahoma, mingliu

为了对font-family取值进行统一,更好的支持各个操作系统上各个浏览器的兼容性,现将font-family统一约束如下:

  1. 1、font-family不允许在业务代码中随意设置

  2. 2、font-family目前取值为

1
2
3
4
5
6
7
8
9
10
11
12
13
14
body {
font: 12px Tahoma, Verdana, STHeiTi, simsun, sans-serif;
}input,
label,
select,
option,
textarea,
button,
fieldset,
legend {
font-family: "lucida grande", tahoma, verdana, arial, STHeiTi, simsun, sans-serif;
}


性能优化
hack使用规范
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }