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;
            }
  • 相关阅读:
    Phone List(字典树)
    Dating with girls(1)(二分+map+set)
    Color the ball(树状数组+线段树+二分)
    python模块导入总结
    Python爬虫之定时抢购淘宝商品
    Celery多队列配置
    python垃圾回收机制
    python变量、对象和引用你真的明白了吗
    使用 supervisor 管理 Celery 服务
    Supervisor的作用与配置
  • 原文地址:https://www.cnblogs.com/lintingting/p/7689268.html
Copyright © 2011-2022 走看看