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

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

文章分类

全部博文(69)

文章存档

2017年(2)

2016年(16)

2015年(21)

2014年(30)

分类: Html/Css

2016-04-19 21:52:52

使用Sublime编写html代码:
html代码

点击(此处)折叠或打开

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>百度</title>
  6.     <link rel="stylesheet" href="../css/baidu.css">
  7. </head>
  8. <body>
  9.     <div>
  10.         <img height="150" src="../img/bd_logo1.png" alt="百度图片">
  11.     </div>

  12.     <div>
  13.         <a style="display:inline-block" href="" title="">新闻</a>
  14.         <a style="display:inline-block" href="" title="">网页</a>
  15.         <a style="display:inline-block" href="" title="">贴吧</a>
  16.         <a style="display:inline-block" href="" title="">知道</a>
  17.         <a style="display:inline-block" href="" title="">MP3</a>
  18.         <a style="display:inline-block" href="" title="">图片</a>
  19.         <a style="display:inline-block" href="" title="">视频</a>
  20.         <a style="display:inline-block" href="" title="">地图</a>
  21.     </div>

  22.     <div>
  23.         <input id="ina" type="text" name="" value="" placeholder="">
  24.         <input id="inb" type="button" name="" value="百度一下" placeholder="">
  25.     </div>

  26.     <div>
  27.         <a class="twoa" style="display:inline-block" href="" title="">百科</a>
  28.         <a class="twoa" style="display:inline-block" href="" title="">文库</a>
  29.         <a class="twoa" style="display:inline-block" href="" title="">hao123</a>
  30.         <a class="twoa" style="display:inline-block" href="" title="">更多>></a>
  31.     </div>

  32.     <div>
  33.         <a class="threea" style="display:inline-block" href="" title="">把百度设为主页</a>
  34.         <a class="threea" style="display:inline-block" href="" title="">把百度添加到桌面</a>
  35.     </div>

  36.     <div>
  37.         <a class="foura" href="" title="">加入百度推广</a>
  38.         <a class="foura" href="" title="">搜索风云榜</a>
  39.         <a class="foura" href="" title="">关于百度</a>
  40.         <a class="foura" href="" title="">About Baidu</a>
  41.     </div>

  42.     <div>
  43.         @2012 Baidu <a href="" title="">使用百度前必读 京ICP证030173号*</a>
  44.     </div>
  45. </body>
  46. </html>
css文件

点击(此处)折叠或打开

  1. /*
  2. * @Author: IT - Pony
  3. * @Date: 2016-04-16 11:11:36
  4. * @Last Modified by: IT - Pony
  5. * @Last Modified time: 2016-04-16 15:49:40
  6. */
  7. *{margin:0;padding:0;}

  8. div{
  9.     text-align: center;
  10. }

  11. a{
  12.     line-height: 40px;
  13.     width: 50px;
  14. }

  15. #ina{
  16.     height: 28px;
  17.     width: 480px;
  18. }

  19. #inb{
  20.     height: 34px;
  21.     width: 100px;
  22.     font-size: 15px;
  23. }

  24. .twoa{
  25.     line-height: 60px;
  26.     width: 50px;
  27. }

  28. .threea{
  29.      width: 130px;
  30.      margin-top: 180px;
  31. }

  32. .foura{
  33.     width: 50px;
  34.     line-height: 10px;
  35. }
运行结果:


代码:

点击(此处)折叠或打开

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>margin百度</title>
  6.     <link rel="stylesheet" href="../css/baidubox.css">
  7.     <script src=""></script>
  8. </head>
  9. <body>
  10.     <div id="oa">
  11.         <a href="" title="">新闻</a>
  12.         <a href="" title="">好123</a>
  13.         <a href="" title="">地图</a>
  14.         <a href="" title="">视频</a>
  15.         <a href="" title="">登录</a>
  16.         <a href="" title="">设置</a>
  17.         <input type="button" name="" value="更多产品" placeholder="">
  18.     </div>

  19.     <div id="ot">
  20.         <img height="200" src="../img/bd_logo1.png" alt="百度图片">
  21.     </div>

  22.     <div id="od">
  23.         <input id="io" type="text" name="" value="" placeholder="">
  24.         <input id="it" type="button" name="" value="百度一下" placeholder="">
  25.     </div>
  26.         
  27.     <div id="td">
  28.         <a href="" title="">把百度设为主页</a>
  29.         <a href="" title="">关于百度</a>
  30.         <a href="" title="">About Baidu</a>
  31.     </div>

  32.     <div id="sd">
  33.         @2014 Baudu <a href="" title="">使用百度前必读</a>京ICP证030173号*
  34.     </div>
  35. </body>
  36. </html>
css文件:

点击(此处)折叠或打开

  1. /*
  2. * @Author: IT - Pony
  3. * @Date: 2016-04-17 10:07:29
  4. * @Last Modified by: IT - Pony
  5. * @Last Modified time: 2016-04-17 10:52:43
  6. */
  7. #oa{
  8.     text-align: right;
  9.     word-spacing: 10px;
  10. }

  11. #ot{
  12.     text-align: center;
  13. }

  14. #od{
  15.     text-align: center;
  16. }

  17. #io{
  18.     height: 30px;
  19.     width: 450px;
  20. }

  21. #it{
  22.     height: 38px;
  23.     width: 100px;
  24.     margin-left: -9px;
  25. }

  26. #td{
  27.     text-align: center;
  28.     margin-top: 200px;
  29. }

  30. #sd{
  31.     text-align: center;
  32.     margin-top: 10px;
  33. }
运行结果:
阅读(1214) | 评论(0) | 转发(0) |
0

上一篇:Java---运算器

下一篇:必应页面

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