3_奥运五环.html 1.6 KB

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