CSS

选择器

css中的选择器

背景颜色、图像

background background-attachment background-clip background-color background-image background-origin backgrond-position background-repeat background-size

文字、字体

color font font-family font-size font-size-adjust font-style font-variant font-weight

文档格式

hanging-punctuation hyphens letter-spacing line-height text-align text-decoration text-indent text-overflow text-shadow text-transform white-space word-spacing word-wrap

宽度和高度

width,height max-width min-width max-height min-height

外缘与内缘余白

margin margin-bottom margin-left margin-right margin-top padding padding-bottom padding-left padding-right padding-top

边框

border border-bottom border-color border-style border-width border-top border-right border-left

边框圆角

border-radius border-bottom-right-radius border-bottom-left-radius border-top-right-radius border-top-left-radius

边框图像

border-image border-image-repeat border-image-slice border-image-source border-image-width

容器与弹性容器

bottom clear clip box-decoration-break box-shadow align-content align-items align-self display flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap justify-content float left outline-offset overflow overflow-x overflow-y order position right resize top vertical-align z-index

透明

opacity rgba

渐变

linear-gradient radial-gradient

文章分栏

break-after break-before break-inside columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width

时间过渡效果

transition transition-delay transition-duration transition-property transition-timing-function

动漫效果

@keyframes animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function

2D、3D变形

transform translate matrix2d matrix3d perspective scale skew rotate transform-origin

颜色、尺寸、单位

角度与URL 颜色 单位长度

表格

border-collapse border-spacing caption-side empty-cells table-layout

列表

counter-increment counter-reset list-style list-style-type list-style-image list-style-position

基本的用户界面属性

box-sizing content cursor nav-index nav-left nav-down nav-right nav-up

CSS基础

font-weight(加粗字体)

font-weight: 值;

font-weight:bold;

font-weight属性用于指定文字字体的粗细。

字体粗细的指定一般分为9段,实际上并没有分的那么细致。通常情况下,加粗文字时,使用[bold]就足够了。

font-weight的值及其说明
属性 说明
font-weight 100 使用数值(如:100、200、…900)指定文字的粗细。
normal(标准,相当数值400) 使用关键词指定,其他还有bold(较一般加粗,相当数值400)、lighter(比一般细)、bolder(更粗)

使用例

.sample1 {font-weight: normal; }

.sample2 {font-weight: bold; }

.sample3 {font-weight: lighter; }

.sample4 {font-weight: bolder; }

.sample100 {font-weight: 100; }

.sample200 {font-weight: 200; }

.sample300 {font-weight: 300; }

.sample400 {font-weight: 400; }

.sample500 {font-weight: 500; }

.sample600 {font-weight: 600; }

.sample700 {font-weight: 700; }

.sample800 {font-weight: 800; }

.sample900 {font-weight: 900; }

浏览器上的显示结果↓

 font-weight属性
标准粗细(相当数值400)。
较一般粗(相当数值700)。
比一般细
更粗
100
200
300
400
500
600
700
800
900
X

浏览器支持情况

IE9IE8Fx4.0Fx3.6Chrome11Safari5Opera11