4_奥运五环.html 1.6 KB

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