您好,欢迎来到刀刀网。
搜索
您的当前位置:首页用html和css创建一个最基本的网页

用html和css创建一个最基本的网页

来源:刀刀网

1.登录页面

2.主网页

3.副网页

 代码部分(主网页):

html:

css部分:

  1. body {
  2.     width: 1400px;
  3.     padding: 0;
  4.     margin: 0 auto;
  5.     border: 1px solid #dcd6d6;
  6. }
  7. .w {
  8.     width: 1200px;
  9.     margin: 0 auto;
  10. }
  11. .fl {
  12.     float: left;
  13. }

  14.  
  15. .fr {
  16.     float: right;
  17. }
  18. .shortcut {
  19.     height: 32px;
  20.     background-color: #f1f1f1;
  21.     line-height: 32px;
  22. }
  23. .shortcut ul li {
  24.     float: left;
  25.     list-style: none;
  26.     margin-top: -18px;
  27. }
  28. .shortcut ul li a {
  29.     text-decoration: none;
  30. }
  31. /* .shortcut ul li:hover {
  32.     color: brown;
  33. } */
  34. .shortcut .fr ul li:nth-child(even) {
  35.     width: 1px;
  36.     height: 12px;
  37.     background-color: #666;
  38.     margin: -7px 15px 0
  39. }
  40. header {
  41.     margin: 0 auto;
  42.     width: 1200px;
  43.     height: 150px;
  44.     /* background-color: aquamarine; */
  45. }
  46. .logo {
  47.     position: absolute;
  48.     margin: 0 auto;
  49.     top: 1px;
  50.     margin-top: 35px;
  51.     margin-left: 0px;
  52.     width: 200px;
  53.     height: 100px;
  54.     /* background-color: burlywood; */
  55. }
  56. .logo a {
  57.     display: block;
  58.     margin-left: 50px;
  59.     width: 100px;
  60.     height: 78px;
  61.     background-image: url(../image/3.jpg);
  62.     background-position: -9px -9px;
  63.     background-repeat: no-repeat;
  64.     text-indent: -9999px;
  65.     overflow: hidden;
  66. }
  67. .search {
  68.     margin: -80px 450px;
  69.     left: 4500px;
  70.     top: 32px;
  71.     width: 600px;
  72.     height: 36px;
  73.     border: 2px solid red;
  74. }
  75. button,
  76. input {
  77.     font-family: "宋体";
  78.     /* 默认有灰色边框,去掉 */
  79.     border: 0;
  80.     /* 蓝色边框去掉 */
  81.     outline: none;
  82.     font-size: 20px;
  83. }
  84. .search input {
  85.     float: left;
  86.     width: 500px;
  87.     height: 36px;
  88.     padding-left: 10px;
  89. }
  90. .search button {
  91.     float: right;
  92.     width: 100px;
  93.     height: 37px;
  94.     background-color: rgb(217, 99, 99);
  95.     font-size: 30px;
  96. }
  97. .hotwords {
  98.     position: relative;
  99.     top: 112px;
  100.     left: 450px;
  101.     width: 630px;
  102. }
  103. .hotwords a {
  104.     font-size: 20px;
  105.     margin: 0 10px;
  106.     text-decoration: none;
  107.     color: #747a76;
  108. }
  109. .nav1 {
  110.     width: 1400px;
  111.     position: relative;
  112.     margin: 0 auto;
  113.     margin-top: 40px;
  114.     border: 2px solid rosybrown;
  115. }
  116. .nav .dropdown {
  117.     float: left;
  118.     width: 300px;
  119.     height: 50px;
  120.     margin: -53px 0px;
  121.     background-color: rgb(231, 171, 160);
  122. }
  123. .nav .navitems {
  124.     float: left;
  125.     margin: -52px 0px;
  126. }
  127. .dropdown .dt {
  128.     width: 100%;
  129.     height: 50px;
  130.     text-align: center;
  131.     line-height: 50px;
  132.     font-size: 25px;
  133.     /* border: solid; */
  134. }
  135. .dropdown .dd {
  136.     position: absolute;
  137.     width: 300px;
  138.     height: 500px;
  139.     margin-top: 3px;
  140.     background-color: rgb(137, 75, 70);
  141. }
  142. .dropdown .dd ul li {
  143.     width: 300px;
  144.     height: 35px;
  145.     line-height: 32px;
  146.     list-style: none;
  147.     margin-left: -40px;
  148.     /* border: solid; */
  149.     text-indent: 2em;
  150. }

  151.  
  152. .dropdown .dd ul li:hover {
  153.     background-color: #fff;
  154. }
  155. .dropdown .dd ul li a {
  156.     font-size: 24px;
  157.     color: #fff;
  158.     text-decoration: none;
  159. }
  160. .dropdown .dd ul li:hover a {
  161.     color: rgb(222, 39, 26);
  162. }
  163. .navitems {
  164.     position: relative;
  165.     left: 350px;
  166.     height: 40px;
  167.     /* background-color: aqua; */
  168. }
  169. .navitems ul li {
  170.     margin-left: 400px;
  171.     float: left;
  172.     margin: 5px 20px;
  173.     list-style: none;
  174.     margin-top: -1px;
  175. }
  176. .navitems ul li a {
  177.     float: left;
  178.     text-decoration: none;
  179.     font-size: 25px;
  180.     color: #918484;
  181. }
  182. .navitems ul li a:hover {
  183.     color: red;
  184. }
  185. /* footer */
  186. .footer {
  187.     clear: both;
  188.     margin-left: 100px;
  189.     height: 600px;
  190.     width: 1400px;
  191.     margin: 0 auto;
  192.     background-color: #f5f5f5;
  193. }
  194. .footer .w {
  195.     width: 1400px;
  196. }
  197. .mod_left {
  198.     height: 120px;
  199.     border-bottom: 1px solid #ccc;
  200. }
  201. .mod_left ul li {
  202.     float: left;
  203.     margin-left: 70px;
  204.     width: 240px;
  205.     height: 100px;
  206.     background-color: rgb(195, 210, 204);
  207.     list-style: none;
  208. }
  209. .mod_left ul li h1 {
  210.     display: block;
  211.     margin-left: 10px;
  212.     width: 20px;
  213.     height: 20px;
  214.     border-radius: 50%;
  215.     background-color: aquamarine;
  216. }
  217. .mod_left ul li h2 {
  218.     margin-left: 50px;
  219.     margin-top: -50px;
  220. }
  221. .mod_left ul li p {
  222.     font-size: 20px;
  223.     margin-left: 30px;
  224. }
  225. .mod_right {
  226.     height: 250px;
  227. }
  228. .mod_right ul li {
  229.     margin-top: 10px;
  230.     list-style: none;
  231.     font-size: 20px;
  232.     text-align: center;
  233.     margin-left: 60px;
  234. }
  235. .mod_right .b {
  236.     font-size: 26px;
  237.     color: #747a76;
  238. }
  239. .mod_right ul {
  240.     float: left;
  241.     margin-left: 100px;
  242. }
  243. .mod_right ul li a {
  244.     text-decoration: none;
  245.     color: #918484;
  246. }
  247. .mod_right ul li a:hover {
  248.     color: rgb(220, 39, 51);
  249. }
  250. /* .s {
  251.     height: 300px;
  252. } */
  253. .last_top {
  254.     width: 1400px;
  255.     border: 1px solid #ccc;
  256.     height: 0px;
  257.     margin-top: 30px;
  258. }
  259. .last_top ul {
  260.     margin-top: 40px;
  261.     margin-left: 230px;
  262. }
  263. .last_top ul li {
  264.     font-size: 16px;
  265.     float: left;
  266.     list-style: none;
  267.     margin: 0 6px;
  268. }
  269. .last_top ul li a {
  270.     text-decoration: none;
  271.     color: #918484;
  272. }
  273. .last_top ul li a:hover {
  274.     color: red;
  275. }
  276. .last_top ul li:nth-child(even) {
  277.     height: 20px;
  278.     width: 1px;
  279.     background-color: #a79797;
  280. }
  281. .last_button {
  282.     margin-top: 80px;
  283.     margin-left: 60px;
  284.     height: 60px;
  285.     width: 1200px;
  286.     color: #5c5252;
  287. }
  288. .last_button p {
  289.     width: 1100px;
  290.     text-align: center;
  291. }

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.com 版权所有 湘ICP备2022005869号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务