zoukankan      html  css  js  c++  java
  • 导航,头部,CSS基础

    1、制作自己的导航条。

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>简书</title>
        <link rel="stylesheet" href="1018.css">
    </head>
    <body>
    <nav>
        <img src="https://p1.ssl.qhmsg.com/dr/270_500_/t01745b3fd4078d5a9e.jpg?size=512x512" height="50" width="50">
        <a href="http://www.jianshu.com/"></a>
        <input type="text" name="search">
        <button type="submit">搜索</button>
        <a href="https://www.jianshu.com/sign_in">登陆</a>
        <a href="https://www.jianshu.com/sign_up">注册</a>
    </nav>

    2、HTML头部元素:

    <base>  定义了页面链接标签的默认链接地址

    <base href="" target="_blank">

    <style>  定义了HTML文档的样式

        <style type="text/css">
            p{
                color: red;
            }
        </style>

    <link>  定义了一个文档和外部资源之间的关系

    <head>
        <meta charset="UTF-8">
        <title>简书</title>
        <link rel="stylesheet" href="1018.css">
    </head>

    3 练习样式表:

    行内样式表

    内嵌样式表

    外部样式表

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>简书</title>
        <link rel="stylesheet" type="text/css" href="1018.css">
        <style type="text/css">
          p{
          color: red;
        }
          .zidingyi{
             color: blue;
        }
        #commentcount{
              background-color: aquamarine;
        }
        </style>
    </head>
    <body>
    <nav>
        <img src="https://p1.ssl.qhmsg.com/dr/270_500_/t01745b3fd4078d5a9e.jpg?size=512x512" height="50" width="50">
        <a href="http://www.jianshu.com/"></a>
        <input type="text" name="search">
        <button type="submit">搜索</button>
        <a href="https://www.jianshu.com/sign_in">登陆</a>
        <a href="https://www.jianshu.com/sign_up">注册</a>
    </nav>
    <p>十九大 <span style="background: black;font-size: 30px;font-family: 微软雅黑">召开</span></p>
    <p>十九大召开</p>
    <p>十九大召开</p>
    <p>十九大召开</p>
    <h1 class="zidingyi">评论</h1>
    <h2><span id="commentcount" >1000</span>点赞</h2>
    </body>
    
    </html>

    4、分别练习定义三类选择器:

      1. HTML 选择器
      2. CLASS 类选择器
      3. ID 选择器
    复制代码
    {#        1  .HTML 选择器#}
            p {
                color: blue;
            }
    {#        2  .CLASS 类选择器#}
            .bk{
                color: lavenderblush;
            }
    {#        3  .ID 选择器#}
            #ok {
                color:  lightseagreen;
            }
  • 相关阅读:
    1442. Count Triplets That Can Form Two Arrays of Equal XOR
    1441. Build an Array With Stack Operations
    312. Burst Balloons
    367. Valid Perfect Square
    307. Range Sum Query
    1232. Check If It Is a Straight Line
    993. Cousins in Binary Tree
    1436. Destination City
    476. Number Complement
    383. Ransom Note
  • 原文地址:https://www.cnblogs.com/lintingting/p/7689268.html
Copyright © 2011-2022 走看看