当前位置:Gxlcms > html代码 > HTML如何制作百度首页?代码是什么

HTML如何制作百度首页?代码是什么

时间:2021-07-01 10:21:17 帮助过:80人阅读

本篇文章给大家带来的内容是关于HTML如何制作百度首页?代码是什么,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

制作百度首页时候,除了要用到p进行分块,还需要对快的位置进行控制,一般有

对p进行规范大小width,height分别对应宽度高度

margin:有对p进行定位有margin-top,margin-left,margin-right,margin-buttom

float-left:吧p元素进行从左到右排列

了解这些简单的操作之后,就可以自己动手做出一个简单百度页面了,例如:

20181020125908318.png

上面的页面html代码如下:

  1. <html>
  2. <head>
  3. <title>百度一下,你就知道</title>
  4. <link href="baidu.ico" rel="shortcut icon" type="ico图标路径"/>
  5. <style>
  6. .p_head{
  7. width:100%;
  8. height:150px;
  9. margin-top:0px;
  10. }
  11. .p_mid{
  12. width:100%;
  13. height:130px;
  14. margin-top:0px;
  15. }
  16. .p_body{
  17. width:100%;
  18. height:200px;
  19. margin-top:0px;
  20. }
  21. .p_base{
  22. width:100%;
  23. height:60px;
  24. float:left;
  25. margin-top:0px;
  26. }
  27. .p_based{
  28. width:100%;
  29. height:100%;
  30. float:left;
  31. margin-top:0px;
  32. }
  33. .p_head1{
  34. width:540px;
  35. height:24px;
  36. float:right;
  37. margin-top:25px;
  38. }
  39. .p_head2{
  40. width:50px;
  41. height:24px;
  42. float:left;
  43. line-height:24px;
  44. text-align:center;
  45. }
  46. .p_mid1{
  47. width:270px;
  48. height:130px;
  49. float:left;
  50. margin-left:39%;
  51. }
  52. .p_body1{
  53. width:600px;
  54. height:36px;
  55. background-color:#999;
  56. float:left;
  57. margin-left:32%;
  58. }
  59. .p_base1{
  60. width:60px;
  61. height:60px;
  62. margin:0 auto;
  63. float:left;
  64. margin-top:5%;
  65. }
  66. </style>
  67. </head>
  68. <body style="margin:0 auto">
  69. <p class="p_head" >
  70. <p class="p_head1">
  71. <p class="p_head2" ><font size="1" ><ins>新闻 </ins></font></p>
  72. <p class="p_head2" ><font size="1" ><ins>hao123</ins> </font></ins></p>
  73. <p class="p_head2" ><font size="1" ><ins>地图 </ins></font></p>
  74. <p class="p_head2" ><font size="1" ><ins>资源 </ins></font></p>
  75. <p class="p_head2" ><font size="1" ><ins>视频 </ins></font></p>
  76. <p class="p_head2" ><font size="1" ><ins>贴吧 </ins></font></p>
  77. <p class="p_head2" ><font size="1" ><ins>学术 </ins></font></p>
  78. <p class="p_head2" ><font size="1" ><ins>登录 </ins></font></p>
  79. <p class="p_head2" ><font size="1" ><ins>设置 </ins></font></p>
  80. <p class="p_head2" style="width:70px;background-color:#38f" ><font size="1" color="white" >更多产品</font></p>
  81. </p>
  82. </p>
  83. <p class="p_mid" >
  84. <p class="p_mid1" >
  85. <a href="https://www.baidu.com/s?wd=%E7%BD%91%E7%BB%9C%E8%A1%A8%E6%83%85%E7%AC%A6%E5%8F%B7%E8%AF%9E%E7%94%9F&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pcs" target="_blank">
  86. <img height=130 width=270 src="https://www.baidu.com/img/bd_logo1.png?where=super" title="百度一下你就知道"/>
  87. </a>
  88. </p>
  89. </p>
  90. <p class="p_body" >
  91. <p class="p_body1" >
  92. <form action="https://www.baidu.com/s" method="get" >
  93. <input style="width:500px;height:36px;"type="text"/><input id="gender" name="gender" type="submit" value="百度一下"style="width:100px;height:36px;"/>
  94. </form>
  95. </p>
  96. </p>
  97. <p class="p_base" >
  98. <p class="p_base1" style="margin-left:48%;">
  99. <img height=60 width=60 src="https://ss1.bdstatic.com/5eN1bjq8AAUYm2zgoY3K/r/www/cache/static/protocol/https/home/img/qrcode/zbios_efde696.png" title="我是一个二维码"/>
  100. </p>
  101. </p>
  102. </body>
  103. </html>

以上就是对HTML如何制作百度首页?代码是什么的全部介绍,如果您想了解更多有关HTML视频教程,请关注PHP中文网。

以上就是HTML如何制作百度首页?代码是什么的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行