3.五环.html 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. div {
  9. width: 200px;
  10. height: 200px;
  11. border-radius: 50%;
  12. border-width: 10px;
  13. border-style: solid;
  14. position: absolute;
  15. }
  16. div::after {
  17. content: "";
  18. width: 200px;
  19. height: 200px;
  20. border-radius: 50%;
  21. position: absolute;
  22. top: -10px;
  23. left: -10px;
  24. }
  25. #red {
  26. border-color: red;
  27. top: 0;
  28. left: 0;
  29. }
  30. #red::after {
  31. z-index: 999;
  32. border-width: 10px;
  33. border-style: solid;
  34. border-color: transparent;
  35. border-right-color: red;
  36. }
  37. #yellow {
  38. border-color: yellow;
  39. top: 0;
  40. left: 230px;
  41. }
  42. #yellow::after {
  43. border: 10px solid #ff0;
  44. border-bottom-color: transparent;
  45. z-index: 888;
  46. }
  47. #blue {
  48. border-color: blue;
  49. top: 0;
  50. left: 460px;
  51. }
  52. #blue::after {
  53. border: 10px solid blue;
  54. }
  55. #green {
  56. border-color: green;
  57. top: 120px;
  58. left: 110px;
  59. }
  60. /* #green::after {
  61. border: 10px solid green;
  62. } */
  63. #blue::after {
  64. border: 10px solid blue;
  65. }
  66. #black {
  67. border-color: black;
  68. top: 120px;
  69. left: 360px;
  70. }
  71. </style>
  72. </head>
  73. <body>
  74. <div id="red"></div>
  75. <div id="yellow"></div>
  76. <div id="blue"></div>
  77. <div id="green"></div>
  78. <div id="black"></div>
  79. </body>
  80. </html>