CSS学习 NO4

来源:互联网 发布:c语言加密程序 编辑:程序博客网 时间:2024/04/30 03:21

      1.在CSS中字体用font表示,字体font的语法是:

     font: font-style || font-varian || font-weight || font-size || line-height || font-fmily

      2.font-style:设置对象中字体的样式,可选参数normal,italic和oblique(正常字体,斜体和倾斜).

         font-variant:设置对象中的文本是否为小型的大写字母,

      3.字体颜色:color:颜色值.

      4.font-size的参数:xx-small,x-small,small,medium,large,x-large,xx-large,larger,smaller,length

      5.font-weight:表示字体的粗细,完整格式:

    font-weight:normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500| 600 | 700 | 800 | 900 |

      6.font-family:字体类型  line-height:行距文  文本间距:word-spaceing  文本间隔:letter-spaceing

      7.文本转化属性:text-transform: 属性为capitalize(使每个词的首字母大写) uppercase(使每个字的所有字母大写)
                                                            lowercase(使每个字的所有字母小写) none(字母以正常形式显示)

      8.文本修饰:基本语法: text-decoration:underline | overline | line-throungh|blink | none

      9.空格处理方式: white-space : normal | pre | nowrap

      10.文本垂直对齐的语法格式:vertical align : baseline/sub/supper/top/text-top/middle/bottom.text-bottom

      11.文本水平对齐:text-align : left/right/center/justify

      12.文本缩进: text-indent : <长度> | <百分比>

      13.背景的语法: Background : background-color/back-image/background-repeat/background-attachment/background-position

      14.背景的对象可以是HTML标记,也可以是CSS中的ID或CLASS对象

      15.背景的颜色的语法: background-color : transparent/color

      16.设置背景的颜色: background-color : transparent/color

      17.设置背景的图像:background-image:none/url

      18.设置背景图像的滚动:background-attachment : scroll/fixed  background-attachment的后面的参数scroll为默认值,表示图像因内容滚动而滚动,而参数fixed是固定的,即背景图像固定在网页中.

      19.设置背景图像位置:   background-position : length/length
                                       background-positon:   positon/position

       20.背景图像的铺排: background-repeat:repeat/no-repeat/repeat-x/repeat-y

        repeat:默认值,背景图像在纵向和横向上平铺

        no-repeat:背景图片不平铺

        repeat-x:背景图像仅在横向上平铺

        repeat-y:背景图像仅在纵向上平铺

      20.设置宽度:width: auto/length

      21.设置高度:heignt :auto/length

      22.层的默认大小是按父对象宽的100%,即该层所在的范围有多宽层就显示,当层在确定宽度时,当层在确定宽度时,也是按左对齐的,所以默认时层不会居中,为了让层居中,就得改变层的默认值.既要确定层的大小.调整层的外补丁.

      23.外补丁:margin,就是对象与外面距离或外延距离,层与层之间的间隔.语法为margin:auto/length


      24.margin:(1)   外面接四个值表示上右下左外沿边的值

                       (2)   外面只接一个数值,表示的是四周的外沿值

                       (3)   只接两个值时,前一个表示上下,后一个表示左右

                       (4)   只接三个值时,第一个表示上面,第二个表示左右,第三个表示下面

      25. margin-top margin-right margin-bottom margin-left

      26.设置层漂移的问题:左边的向左漂移,右边的向右漂移






 











 

原创粉丝点击