12_练习.html 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <style>
  9. #nav {
  10. width: 1199px;
  11. height: 35px;
  12. line-height: 35px;
  13. background: #EEEEEE;
  14. }
  15. .left {
  16. float: left;
  17. }
  18. .right {
  19. float: right;
  20. }
  21. #nav a {
  22. text-decoration: none;
  23. color: #888888;
  24. font-family: PingFang SC;
  25. font-size: 12px;
  26. }
  27. #nav .active {
  28. color: #6F26BD;
  29. }
  30. </style>
  31. </head>
  32. <body>
  33. <div id="nav">
  34. <!-- 左边的 -->
  35. <div class="left">
  36. <a href="#">您好,欢迎进入包图购物网</a>
  37. <a href="#" class="active">注册</a>
  38. <a href="#">登录</a>
  39. </div>
  40. <!-- 右边的 -->
  41. <div class="right">
  42. <a href="#">设为首页 ☆</a>
  43. <a href="#" class="active">加入收藏</a>
  44. <a href="#">| 客户服务 </a>
  45. <a href="#">| 关注官方微博:</a>
  46. </div>
  47. </div>
  48. <script>
  49. // var x = 3;
  50. // function foo() {
  51. // var x = 1;
  52. // console.log(x); // 1
  53. // (function () {
  54. // var y = 2;
  55. // console.log(x); // 1
  56. // console.log(y); // 2
  57. // })();
  58. // console.log(y);
  59. // }
  60. // foo();
  61. // console.log(x);
  62. console.log(1);
  63. setTimeout(() => {
  64. console.log(2);
  65. Promise.resolve().then(() => {
  66. console.log(3);
  67. });
  68. });
  69. console.log(4);
  70. new Promise((resolve, reject) => {
  71. console.log(5);
  72. resolve();
  73. }).then(() => {
  74. console.log(6);
  75. setTimeout(() => {
  76. console.log(7);
  77. });
  78. });
  79. console.log(8);
  80. </script>
  81. </body>
  82. </html>