zoukankan      html  css  js  c++  java
  • CSS选择器

    1.标签选择器

    <style  type="text/css">

    p    //格式对p标签起作用

    {

        样式;

    }

    </style>

    2.class选择器--都是“.”开头

    <head>

    <style type="text/css">

    .main    /*定义样式*/

    {

        height:34px;

        67px;

        text-align:center;

    }

    </style>

    </head>

    <body>

    <div class="main">

    </div>

    </body>

    3.ID选择器--以“#”开头

    <div  id="样式名">

    <head>

    <style type="text/css">

    #main    /*定义样式*/

    {

        height:34px;

        67px;

        text-align:center;

    }

    </style>

    </head>

    <body>

    <div id="main">

    </div>

    </body>

    4.复合选择器

    (1)用“,”隔开,表示并列

    <style  type="text/css">

    p,span  /*标签p,span两者同样的样式*/

    {

      样式;

    }

    </style>

    (2)用空格隔开,表示后代

    <style  type="text/css">

    .main  p  /找到使用“main”的标签,在该标签里的p标签使用该样式/

    {

      样式;

    }

    </style>

    (3)筛选“.”

    <style  type="text/css">

    p.sp  /在标签p中的clss="sp"的标签,执行以下样式/

    {

      样式;

    }

    </style>

  • 相关阅读:
    golang交叉编译:Linux
    vmware共享文件夹
    虚拟机-Debian服务器配置
    day38--MySQL基础二
    day19-IO多路复用
    mysql 对时间的处理
    mysql 优化
    Linux性能查看
    day18-socket 编程
    JAVA 消耗 CPU过高排查方法
  • 原文地址:https://www.cnblogs.com/jc535201285/p/6245567.html
Copyright © 2011-2022 走看看