zoukankan      html  css  js  c++  java
  • css定位的三种选择器

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <style type="text/css">
    p {
    color:red;
    }

    </style>
    </head>
    <body>
    <!--
    标签选择器:
    语法: 标签名 {
    属性键:属性值;
    }
    -->
    <p>itcast传智播客</p>
    <p>itcast传智播客</p>
    </body>
    </html>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <style type="text/css">
    #one {
    color:red;
    }

    </style>
    </head>
    <body>
    <!--
    ID属性唯一标识符.
    要确保页面当中id属性的唯一性.
    ID选择器:
    语法: #ID {
    属性键:属性值;
    }
    -->
    <p id="one" >itcast传智播客</p>
    <p>itcast传智播客</p>
    </body>
    </html>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <style type="text/css">
    .one {
    color:green;
    }

    </style>
    </head>
    <body>
    <!--
    class属性可以随意重复.

    CLASS选择器:
    语法: .CLASS名称 {
    属性键:属性值;
    }
    -->
    <p class="one" >itcast传智播客</p>
    <p>itcast传智播客</p>
    <p>itcast传智播客</p>
    <p class="one" >itcast传智播客</p>
    <h1 class="one" >itcast传智播客</h1>
    </body>
    </html>

  • 相关阅读:
    初步掌握HBase
    基于HBase0.98.13搭建HBase HA分布式集群
    获取当前目录中的文件个数
    MapReduce链接作业
    MapReduce二次排序
    使用map端连接结合分布式缓存机制实现Join算法
    字符串匹配算法-BM
    统计电视机顶盒中无效用户数据,并以压缩格式输出有效用户数据
    字符串匹配算法-KMP
    MapReduce中的Join算法
  • 原文地址:https://www.cnblogs.com/nextgg/p/7646152.html
Copyright © 2011-2022 走看看