css使用技巧

1) 网站上经常会出现用户输入一大段字符和字母以至于文字无法正常折行,把版式破坏,这样我们就要参考以下样式:word-wrap:break-word; overflow:hidden; 当然必须得有宽度属性值。

2) 文字过长要出现省略号样式如下:

white-space: nowrap; text-overflow:ellipsis; overflow:hidden;

3) 一个完整的表单应该包括:

<fieldset>
<legend></legend>
<label></label>
<input />
</fieldset>

4)按照推荐Css属性书写顺序:

显示属性:

display || visibility
list-style : list-style-type || list-style-position || list-style-image
position
top || right || bottom || left
z-index
clear
float

自身属性:   

width
max-width || min-width
height
max-height || min-height
overflow || clip
margin : margin-top || margin-right || margin-bottom || margin-left
padding : padding-top || padding-right || padding-bottom || padding-left
outline : outline-color || outline-style || outline-width
border
background : background-color || background-image || background-repeat || background-attachment || background-position

文本属性:

color
font : font-style || font-variant || font-weight || font-size || line-height || font-family
font : caption | icon | menu | message-box | small-caption | status-bar
text-overflow
text-align
text-indent
line-height
white-space
vertical-align
cursor

posted @ 2014-06-27 18:19  風吹小屁屁  阅读(126)  评论(0编辑  收藏  举报