代码改变世界

导航,头部,CSS基础

2017-10-17 14:04  055李小锐  阅读(249)  评论(0)    收藏  举报
  1. 制作自己的导航条。
  2. HTML头部元素:
    1. <base>  定义了页面链接标签的默认链接地址
    2. <style>  定义了HTML文档的样式文件
    3. <link>  定义了一个文档和外部资源之间的关系
  3. 练习样式表:
    1. 行内样式表
    2. 内嵌样式表
    3. 外部样式表
  4. 分别练习定义三类选择器:
    1. HTML 选择器
    2. CLASS 类选择器
    3. ID 选择器
      <!DOCTYPE html>
      <html lang="en">
      <head>
          <meta charset="UTF-8">
          <title>MISS</title>
          <base href="http://i1.sinaimg.cn/dy/weather/main/index14/007/icons_32_yl/"target="_blank">
          <link rel="stylesheet" type="text/css" href="T5.css">
          <style type="text/css">
              p{
                  color:darkcyan;font-size: 10px;
              }
              .textblue{
                  color:blue;
                  text-decoration: underline;
              }
              .tea{
                  background-color:yellow;
              }
              c{
                  color:yellow;
              }
          </style>
      
      </head>
      <body>
           <nav>
               <img src="w_02_08_00.png">
               <a href="http://www.gzcc.cn/">首页</a>
               <a href="">下载</a>
               <input type="text" name="search">
               <button type="submit">搜索</button>
               <a href="">登录</a>
               <a href="">注册</a>
           </nav>
      
      
      <hr>
           id选择器和class选择器
      <p>  双11全部商品</p>
      <p class="tea">  双11全部商品</p>
      <p class="textblue">  双11全部商品</p>
      <p class="tea">扎实推进“活力广商”建设——我校举行2017年阳光体育长跑活动启动仪式!</p>
      
           <hr>
           行内样式
      <div style="width:500px;height:50px;background:black;"></div>
      内嵌样式
      <style type="text/css">
      #div{width:500px;height:50px;background:black;}
      </style>
      <div id="div"></div>
           外部样式
      <div id="div"></div>
           <hr>
           <h1> MIS问答平台</h1>
      
      <div id="container" style="width: 400px">
          <div id="header" style="background-color: bisque"><h2 align="center"
      style="margin-bottom: 0;">登录</h2></div>
      
      <div id="content" style="background-color: bisque;height: 150px;width: 400px;float: left;"align="center">
      <from>
                  username<input type="text" name="firstname">  <br>
                  password<input type="password" name="pwd" >    <br>
          <input type="radio" name="role" value="stu" center >student
          <input type="radio" name="vehicle" value="Bike">teacher<br>
          <input type="button" value="replace">
      </from>
      
      
      </div>
              <div id="footer" style="background-color: bisque;clear: both;text-align: center;"> duym</div>
      </div>
      <hr>
      
      <div id="container" style="width: 400px">
          <div id="header" style="background-color: lightskyblue"><h2 align="center"
      style="margin-bottom: 0;"></h2>相关栏目    related sections</div>
      
      <div id="content" style="background-color: lightskyblue;height: 250px;width: 400px;float: left;">
      <from>
          <select>
              <option>问答</option>
              <option>提问</option>
              <option>收藏</option>
          </select>
      
      
      </from>
          <ul>
              <li>教师常用表格</li>
              <li>学生常用表格</li>
              <li>教学管理表格</li>
              <li>教学管理文件</li>
              <li>参考资料</li>
      
          </ul>
          <ol>
              <li>教师常用表格</li>
              <li>学生常用表格</li>
              <li>教学管理表格</li>
              <li>教学管理文件</li>
              <li>参考资料</li>
          </ol>
      </div>
      </div>
              <div id="footer" style="background-color: lightskyblue;clear: both;text-align: center;"></div>
      <hr>
      
      
      
      
      
      </body>
      </html>

      css代码

    4.         p{
                  color:red;
              }
              .textblue{
                  color:blue;
              }
              tea{
                  background-color:#FFD700;
              }
              div{width:500px;
                  height:50px;
                  background:black;
              }