10.垂直导航.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. ul {
  9. /* 取消列表默认样式 */
  10. list-style: none;
  11. }
  12. a {
  13. /* 取消a标签默认样式
  14. none 取消
  15. underline 下划线
  16. line-through 删除线
  17. overline 上划线
  18. */
  19. text-decoration: none;
  20. }
  21. ul li {
  22. width: 100px;
  23. height: 100px;
  24. background: red;
  25. margin-top: 10px;
  26. /* 文本在已知宽高的盒子内居中 */
  27. text-align: center;
  28. line-height: 100px;
  29. }
  30. ul li a {
  31. color: yellow;
  32. }
  33. /* 划过 :hover */
  34. ul li:hover {
  35. background: #00f;
  36. }
  37. ul li:hover a {
  38. color: #fff;
  39. font-size: 30px;
  40. font-weight: bold;
  41. }
  42. #box {
  43. width: 100px;
  44. height: 100px;
  45. background: red;
  46. /* 将元素转成行内元素 */
  47. display: inline;
  48. }
  49. #box1 {
  50. width: 100px;
  51. height: 100px;
  52. background: yellow;
  53. /* 将元素转成行内块元素 */
  54. display: inline-block;
  55. }
  56. span {
  57. /* 将元素转成块元素 */
  58. display: block;
  59. }
  60. #content {
  61. width: 300px;
  62. height: 300px;
  63. background: aqua;
  64. /* 圆角 */
  65. /* border-radius: 50px; */
  66. /* 左下 */
  67. border-bottom-left-radius: 20px;
  68. border-top-left-radius: 10px;
  69. border-bottom-right-radius: 30px;
  70. border-top-right-radius: 50px;
  71. }
  72. input {
  73. border: 2px solid #f00;
  74. border: none;
  75. /* 轮廓 */
  76. outline: none;
  77. outline: 3px solid #00f;
  78. }
  79. </style>
  80. </head>
  81. <body>
  82. <div>
  83. <input type="text">
  84. <div id="content"></div>
  85. <span>333</span><span>44</span>
  86. <div id="box">111</div>
  87. <div id="box1">222</div>
  88. <ul>
  89. <li><a href="">首页</a></li>
  90. <li><a href="">我的</a></li>
  91. <li><a href="">购物车</a></li>
  92. <li><a href="">登录</a></li>
  93. </ul>
  94. </div>
  95. </body>
  96. </html>