css-装饰

css

  -在标签上设置style样式

    background-color:#2356a1

    height:48px

  -编写样式方法

    1.标签的style属性

    2.鞋子head里面,style标签中编写

      -id选择器

        #i1{  

            background-color:#2356a1;

            height:48px;

            }

      -class 选择器 

        .c1{  

            background-color:#2356a1;

            height:48px;

            }

      -标签选择器(所有div都改)

        div{

          ...

            }

      -关联选择器(空格)

      -组合选择器(逗号)

      -属性选择器(例如input[type='text'])

        通过属性进行筛选

      优先级,标签上的style优先,然后按顺序优先

    2.1写在单独文件,在head里引用css文件

    3.注释

    4.边框  -border:

      宽度,样式,颜色

    5.height,width,(像素 39px,百分比 45%)

     水平方向:text-align:center,  垂直方向:line-hight:height的高度

     字体大小:font-size    加粗:font-weight

    6.float

      让块级标签堆叠,

      <div style='clear:both;'></div>

    7.display  

      行内inline;块级block具有inline和block:inline-block

      *******

      行内标签不能设置高度,宽度,padding,margin

      块级标签可以。

    8.padding margin(0,auto)

      内边距,

      外边距:margin

    9.position:

      fixed:用来固定在某个位置

      absolute+relative:固定在相对路径

        <div style='position:relative><div style='position:absolute></div></div>

     opacity:相对透明度

     z-index : 层级顺序

     10.overflow:

        hidden

        auto

     11.hover 当鼠标移动到上面才应用相应的css配置

        12.backgroud-image:url(路径)

       backgroud-repeat:

       backgroud-position:

 

posted @ 2017-08-15 23:29  痴道三  阅读(306)  评论(0编辑  收藏  举报