zmrainbows吧 关注:7贴子:320
  • 11回复贴,共1
1L随笔备忘


1楼2022-10-04 00:07回复
    发个帖半个小时不出来,拉倒吧


    2楼2022-10-04 11:54
    回复
      优先级加权值(选择器)
      标签、伪元素、对象选择器1
      类、属性10
      ID100
      其他0
      继承父类特殊性0
      优先级最高!important
      放在声明语句与分号中间
      span {
      font-size:30px !important;
      }


      3楼2022-10-04 11:59
      回复
        html5基本框架
        <!doctype html>
        <html>
        <head>
        <meta charset="utf-8">
        <title></title>
        <link ref="css.css " rel="stylesheet" type="text/css"/> /*外部链接css*/
        <style type="text/css"> /*内部链接css*/
        div {
        margin:auto;
        height:200xp;
        background-color:red;
        }
        </style>
        </head>
        <body>
        <div></div>
        </body>
        </html>


        4楼2022-10-04 12:05
        回复
          通配选择器
          * {
          margin:0px;
          padding:0px;
          }


          5楼2022-10-04 12:48
          回复
            子选择器
            div>span {
            }
            包含选择器
            div span {
            }
            前者简便;后者全面


            6楼2022-10-04 12:53
            回复
              相邻选择器(p标签相邻的h3应用样式)
              p+h3 {
              }
              兄弟选择器(p标签后所有h3应用样式)
              p~h3 {
              }


              7楼2022-10-04 13:01
              回复
                分组选择器,逗号分开,实现集体声明
                h1,h2,h3,h4 {
                }


                8楼2022-10-04 13:03
                回复
                  属性选择器
                  E[attr]


                  9楼2022-10-04 13:09
                  收起回复
                    伪类选择器
                    语法:E:pseidp-class {property:value}


                    10楼2022-10-04 13:18
                    回复
                      锚点伪类:link,visited
                      行为伪类:hover、:active、focus
                      L,V,H,A顺序不能错
                      结构伪类:
                      :first-child
                      :last-child
                      等等9种,比较复杂略
                      否定伪类
                      :not()
                      状态伪类
                      disabled="disabled"
                      checked="checkde"


                      11楼2022-10-04 13:29
                      回复
                        目标伪类
                        ..
                        div:target{background-color:red;}
                        ..
                        URLl#red


                        12楼2022-10-04 13:33
                        回复