Chinaunix首页 | 论坛 | 博客
  • 博客访问: 322648
  • 博文数量: 69
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 759
  • 用 户 组: 普通用户
  • 注册时间: 2014-09-09 14:15
个人简介

〆 人生就是拼命地奔跑,和华丽的跌倒。 つ

文章分类

全部博文(69)

文章存档

2017年(2)

2016年(16)

2015年(21)

2014年(30)

分类: Html/Css

2016-05-07 17:21:42

Sublime编写源代码:
html

点击(此处)折叠或打开

  1. <!DOCTYPE html>
  2. <html lang="zh-cn">
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>九宫格导航页面</title>
  6.     <link rel="stylesheet" href="../css/jiugongge.css">
  7. </head>
  8. <body>
  9.     
  10.     <div id="head">
  11.           <img class="img1" src="../img/" alt="学信教育">
  12.             <div class="head1">
  13.               <img class="img2"src="../img/denglu.jpg" height="15" width="16" alt="登录">
  14.               <a href="" title="">登录</a>
  15.               <a href="" title="">注册</a>
  16.             </div>
  17.       </div>
  18.       
  19.       <div class="clear"></div>
  20.       
  21.       
  22.       <div id="middle">
  23.         <ul>
  24.             
  25.             <li class="content">
  26.                 <div class="inside3">
  27.                   <a href="" title=""><img class="imgcontent1" src="../img/shipin.jpg" alt="视频图片"></a>
  28.                 </div>
  29.                 <div class="outside3">
  30.                   <a href="" title=""><img class="imgcontent" src="../img/jingxuanshiti.jpg" alt="精选试题"></a>
  31.                 </div>
  32.             </li>
  33.             <li class="content">
  34.                 <div class="inside4">
  35.                   <a href="" title=""><img class="imgcontent" src="../img/shijuan.jpg" alt="试卷图标"></a>
  36.                 </div>
  37.                 <div class="outside4">
  38.                   <a href="" title=""><img class="imgcontent" src="../img/ziliao.jpg" alt="资料"></a>
  39.                 </div>
  40.             </li>
  41.             <li class="content">
  42.                 <div class="inside5">
  43.                     <div class="inside1">
  44.                       <a href="" title=""><img class="imgcontent" src="../img/meiriyilian.jpg" alt="每日一练"></a>
  45.                     </div>
  46.                     <div class="inside2">
  47.                       <a href="" title=""><img class="imgcontent" src="../img/zhentiyanlian.jpg" alt="真题演练"></a>
  48.                     </div>
  49.                 </div>
  50.                 <div class="outside5">
  51.                   <a href="" title=""><img class="imgcontent2" src="../img/jiaoliu.jpg" alt="交流">在线交流,让你学习考试更简单</a>
  52.                 </div>
  53.             </li>
  54.         </ul>
  55.       </div>
  56. </body>
  57. </html>
link导入css文件:

点击(此处)折叠或打开

  1. /*
  2. * @Author: IT - Pony
  3. * @Date: 2016-05-07 10:24:56
  4. * @Last Modified by: IT - Pony
  5. * @Last Modified time: 2016-05-07 16:38:47
  6. */
  7. /*声明字符编码集utf-8*/
  8. @charset "utf-8";
  9. *{
  10.     margin: 0;
  11.     padding: 0;
  12. }

  13. #head{
  14.     height: 45px;
  15.     background-color: #000;
  16. }

  17. .head1{
  18.     margin-left: 1000px;
  19.     float: right;
  20.     line-height: 45px;
  21. }

  22. /*清除浮动*/
  23. .clear{
  24.     clear: both;
  25. }

  26. .head1 a{
  27.     height: 45px;
  28.     color: #fff;
  29.     text-decoration: none;
  30.     margin-right: 20px;
  31. }

  32. .img1{
  33.     margin-left: 15px;
  34.     margin-top: 5px;
  35. }

  36. #middle{
  37.     height: 555px;
  38.     /*border: 1px solid green;*/
  39.     background-image: url("../img/beijingtupian.jpg");
  40. }

  41. .content{
  42.     height: 400px;
  43.     width: 418px;
  44.     /*border: 1px solid red;*/
  45.     float: left;
  46.     margin-top: 154px;
  47.     margin-left: 15px;
  48. }

  49. /*将无序列表前面的小黑点去掉*/
  50. ul{
  51.     list-style: none;
  52. }

  53. div .inside3{
  54.     width: 416px;
  55.     height: 255px;
  56.     /*border: 1px solid green;*/
  57.     background-color: #ae1f00;
  58. }

  59. div .inside4{
  60.     width: 416px;
  61.     height: 255px;
  62.     /*border: 1px solid green;*/
  63.     background-color: #29b77b;
  64. }

  65. div .inside5{
  66.     width: 416px;
  67.     height: 255px;
  68.     /*border: 1px solid green;*/
  69. }

点击(此处)折叠或打开

  1. div .outside3{
  2.     width: 416px;
  3.     height: 121px;
  4.     /*border: 1px solid black;*/
  5.     margin-top: 20px;
  6.     background-color: #ff8001;
  7. }

  8. div .outside4{
  9.     width: 416px;
  10.     height: 121px;
  11.     /*border: 1px solid black;*/
  12.     margin-top: 20px;
  13.     background-color: #1f62cb;
  14. }

  15. div .outside5{
  16.     width: 416px;
  17.     height: 121px;
  18.     /*border: 1px solid black;*/
  19.     margin-top: 20px;
  20.     background-color: #681bb9;
  21.     text-decoration: none;
  22. }

  23. .outside5 a{
  24.     text-decoration: none;
  25.     color: #fff;
  26.     font-size: 20px;
  27.     font-weight: bold;
  28. }

  29. .inside1{
  30.     width: 416px;
  31.     height: 121px;
  32.     /*border: 1px solid black;*/
  33.     background-color: #00c1ff;
  34. }

  35. .inside2{
  36.     width: 416px;
  37.     height: 121px;
  38.     /*border: 1px solid black;*/
  39.     margin-top: 10px;
  40.     background-color: #ff8001;
  41. }

  42. .imgcontent{
  43.     margin-top: 30px;
  44.     margin-left: 100px;
  45. }

  46. .imgcontent1{
  47.     margin-top: 30px;
  48.     margin-left: 135px;
  49. }

  50. .imgcontent2{
  51.     margin-top: 30px;
  52.     margin-left: 40px;
  53. }
运行结果:

阅读(1324) | 评论(0) | 转发(0) |
1

上一篇:BLOG页面

下一篇:简单的页面

给主人留下些什么吧!~~