zoukankan      html  css  js  c++  java
  • 父子选择器及选择器使用技巧

    1.父子选择器

    #style2{
        font-weight: 30px;
        background-color: silver;
        color: black;
    }
    /*父子选择器*/
    #style2 span{
        font-style: italic;
        color: red;
    }
    #style2 span span{
        font-size: 50px;
    }

    html:

    <span id="style2">这是一则<span>非常<span>重要</span></span>的新闻</span><br/>

    1.子选择器标签要是可以识别的

    2.父子选择器可以多级的

    3.父子选择器可以适用于其他的选择器

    4.如果一个元素被id class同时修饰,id的优先级高于class

        <span class="hello" id="special">新闻一</span>

    5.一个元素最多有一个id选择器,但可以有多个类选择器

    希望新闻三是下划线、同时是斜体

    a.给新闻三配置id选择器

    b.再指定类选择器

    <span class="hello style3">新闻二</span>

    class hello与class style3那个为准?

    css文件中记录那个排在最后以哪个为准

    6. 优先级id>css>html

    7.在有些css文件中,我们可以将多个选择器共同的内容整合

  • 相关阅读:
    线程安全,syncronized 用法
    线程
    Log4j2
    线性规划
    不要在using语句中调用WCF服务
    kibana 查询语法
    ES中DSL查询相关
    ES通过API调整设置
    ElasticSearch架构思考(转)
    Elasticsearch集群UNASSIGNED
  • 原文地址:https://www.cnblogs.com/helloworld2019/p/10902325.html
Copyright © 2011-2022 走看看