3.奥运五环.html 1.8 KB

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