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基础

更新时间:2014年9月20日

word-wrap(途中改行)

word-wrap: 值;

word-wrap: normal;

当表示过长的单词或单语时,由于所定范围内不能全部容纳整个单词或单语,使用word-wrap属性定义允许单词或单语在适合位置改行。

word-wrap的值及其说明
属性 说明
word-wrap normal 只有有改行符的位置能改行,没有改行符的位置不改行。
break-word 没有改行符的位置,根据需要可以改行。

css文件

.sample1,.sample2 {

width:200px;

margin:0.5em;

background-color:#f0e68c;

}

.sample1 {

-ms-mord-wrap: normal;

word-wrap:normal;

}

.sample2 {

-ms-mord-wrap: break-word;

word-wrap:break-word;

}

链接了上述css文件的html文件

<!DOCTYPE html>

<html lang="zh">

<head>

<meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1">

<link href="material/word-wrap.css" rel="stylesheet" type="text/css" />

<title>word-wrap属性</title>

</head>

<body>

<div class="sample1">word-wrap:normal<br>Default.linesmaybreakonlyatallowedbreakpoints.Default.Linesmaybreakonlyatallowedbreakpoints.</div>

<div class="sample2">word-wrap:break-word<br>Anunbreakablewordaybebrokenatanarbitrarypointiftherearenootherwise-acceptablebreakpointsintheline.</div>

</body>

</html>

浏览器上的显示结果↓

 word-wrap属性
word-wrap:normal
Default.linesmaybreakonlyatallowedbreakpoints.Default.Linesmaybreakonlyatallowedbreakpoints.
word-wrap:break-word
Anunbreakablewordaybebrokenatanarbitrarypointiftherearenootherwise-acceptablebreakpointsintheline.
X

不同浏览器上的书写方法及对应情况

IE9IE8
-ms-word-wrap(word-wrap)-ms-word-wrap(word-wrap)
Fx4.0Fx3.6Chrome11Safari5Opera11
word-wrapword-wrapword-wrapword-wrapword-wrap