css基础认识一

一:css样式表

             1.内联式

             2.嵌入式

             3.外部样式


二:文档树


三:选择器

             1.元素选择器                                div {color:red;}

             2.类选择器                                   .class_name {color:red;font-size:20px;}

             3.ID选择器                                    #name {color:red;}

             4.包含选择器                                div p {color:red;}

             5.通配符选择器                            *{color:red;}

             6.伪类选择器                                a:link {color:red;} a:visited {color:red;} a:hover {color:red;} a:active {color:red;} div:hover {color:red;}

             7.伪元素选择器                             p:first-line{color:red;} p:first-letter{color:red;}

             8.属性选择器                                 input [ type="password"] {background: #fa1;}


四:样式规则

           选择器{属性:值;属性:值;……} 


五:css属性单位

                  1)长度单位:1em=16px=100%

                  2)颜色单位:color:rgb(50%;20%;30%)       color:rgb(234,45,34)            color:#234df5         color:#4ef=color:#44eeff

                  3)URL单位:background-image:url("pic.png")


六:字体属性

                        font-family:黑体;                         字体
font-size:20px;                           大小
font-weight: 900;                        粗细
font-style: oblique;                     斜体
text-decoration:underline;         下划线
color:red;                                   颜色

七:文本属性

                        width:200px;                               宽度
background-color:gray;              背景颜色
text-align:center;                        居中
text-indent:2em;                         缩进

                        text-shadow:black;                     阴影    

                        line-height:10px;                        行高

                        letter-spacing:0.1em;                 字间距

                        word-spacing:0.1em;                 词间距

                        text-transform:capitalize;           大小写

                        white-space:nomal;                   空白显示


八:属性选择的优先级

                        1.内联样式

                        2.ID选择器

                        3.属性选择器、类选择器

                        4.元素选择器

                        5.通配符选择器


九:样式优先级

                        1.内联式

                        2.嵌入式

                        3.外部样式

                        4.浏览器缺省

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值