CSS_02 文字属性_文本属性_背景属性_列表属性

来源:互联网 发布:图书数据加工人员 编辑:程序博客网 时间:2024/06/01 09:07

CSS属性


1、CSS中的文字属性


            属性名称              属性值                  说明

                     font-style      normal          正常显示

                                                 italic          斜体

 

                     font-variant    normal          正常显示

                                                 small-caps      将英文大小写字母写调为同宽

      

                     font-weight     normal          正常显示

                                                 bold            粗体

             

                     font-size       像素                     字体大小

                                                 百分比                  字体大小

             

                     font-family     字体名称              设置字体名称

2、CSS中的文本属性

                           

          属性名称                     属性值                     说明


                     color            十六进制                   颜色      

                                                   英文名称                   颜色

                                                    三原色单位              颜色

 

                     letter-spacing      normal         正常显示

                                                        长度                     文本间隔

 

word-spacing      normal         正常显示

数字         单词间距

 

white-space         normal         文本自动处理换行

pre            换行和空白受保护

nowrap         强制在同一行显示

 

            text-align          left           文字靠左

                                                        right          文字靠右

                                                        center         文字靠中

 

                     text-decoration     none            正常显示

                                                        underline       加上下划线

                                                        overline        加顶线

                                                        line-through    加删除线

 

                     text-indent         长度                     首行缩进

                                                        百分比                  同上

 

line-height         像素            行高

数字/百分比     行高

 

                     text-transform      none            正常显示可以包含大,小字符

                                                        capitalize      字符串第一个字符大写

                                                        uppercase       设置大写字符

                                                        lowercase       设置小写字符

 

 

                     vertical-align      sub            设置文字为下标。

                                                        super          设置文字为上标。

                                                        top            元件往上端靠齐。

                                                        middle         设置文字是在中线位置。

                                                        bottom         元件往下端靠齐。

3、CSS中背景的使用


                   属性名称                            属性值                     说明

              background-attachment   scroll         设置背景图像会随视窗滚动

条的移动而移动。      

                                                        fixed         设置背景图像不会随视窗滚动条

的移动而移动。

      

              background-color      十六进制              background-color:#ff0000;

                              英文名称              background-color:red;

                              三原色                 background-color:rgb(255,0,0)

                             transparent      background-color:transparent;透明

 

              background-image      URL            background-image:url("bg.jpg")

背景图片

                                                     none           不设置背景图片

 

              background-position   top left         设置背景图案出现在上左方。

                                                     top center       设置背景图案出现在上方中间。

                                                      top right        设置背景图案出现在上右方。

                                                      center left      设置背景图案出现在中间左方。

                                                       center center    设置背景图案出现在IE中间。

                                                       center right     设置背景图案出现中间右方。

                                                       bottom left      设置背景图案出现在下左方。

                                                        bottom          设置背景图案出现在正下方。

                                                        bottom right    设置背景图案出现在下右方。

                                         

              background-repeat      repeat         将背景图案填满整个背景。

                                                        repeat-x      将背景图案在水平方向添满。

                                                        repeat-y      将背景图案在垂直方向添满。

                                                        no-repeat      图案只出现一次。

 

                     背景图案简化方案:

                     background:颜色 背景图片 repeat attachment position


4、CSS中列表的使用

     

           属性名称         属性值           说明

         list-style-type    none            无符号

                            disc            实体的小圆点。

                           circle           空心的小圆点。

                           square           实心的小方块。

                           decimal          1,2,3...

                           lower-roman      i,ii,iii...

                           upper-roman      I,II,III...

                           lower-alpha      a,b,c,d,e...

                           upper-alpha      A,B,C,D,E...

           

         list-style-position inside         清单项目较往右移。

                            outside         清单项目正常显示。

         list-style-image     URL          list-style-image:url(lmk.gif)

                            none            不会显示任何图象

 

         清单的简化设置:

         list-style:circle inside url("bullet.gif")  


0 0