样式属性

2018.1.9

样式属性

1,背景与前景

.a
        { background-color:#000;    /*背景色,样式表优先等级最高*/
         background-image:url(路径);/*设置背景图片*/
         background-attachment:fixed;/*背景是固定的,不随字体滚动*/
         background-attachment:scroll;/*背景岁字体滚动*/
         background-repeat:no-repeat;/*repeat-平铺,no-repeat-不平铺,repeat-x横向平铺,repeat-y纵向平铺*/
         background-position:center;/*背景图居中,设置背景图位置时repeat必须为no-repeat*/
         background-position:right top;/*背景图放在右上角 (方向可以自己改 )*/
         background-position:left 100px top 200px;/*离左边100像素,离上边100像素()可为负值,*/
            
            }

2,字体

.a
        {   
            font-family:"字体";/*字体*/
            font-size:9px;/*字体大小*/
            font-weight:bold;/*bold加粗,normal正常*/
       font-style:italic/*倾斜*/
       color:#000;/*颜色*/ text-decoration:underline;/*下划线,overline上划线,line-through删除线,none去掉下划线*/ text-align:center;/*(水平对齐)居中对齐,left左对齐,right右对齐*/ vertical-align:middle;/*(垂直对齐)居中对齐,top顶部对齐,bottom下部对齐,一般设置行高后使用*/ text-indent:28px;/*首行缩进量*/ line-height:24px;/*行高*/ display:none;/*none不显示;inline-block显示为方块,不自动换行,宽高可设;block显示方块,自动换行;inline效果同span标签,不自动换行,宽高可设*/ visibility:hidden/*可视性。hidden,隐藏但占空间;visible显示*/ }
原文地址:https://www.cnblogs.com/sgb13527/p/8267679.html