Sample code for implementing the Olympic rings with pure HTML+CSS

Sample code for implementing the Olympic rings with pure HTML+CSS

Rendering

Code - Take the blue and yellow rings as an example

 <div class="container">
    <div class="ring blue"></div>
    <div class="ring yellow yellow1"></div>
    <div class="ring yellow yellow2"></div>
</div>
.ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    position: absolute;
    border-style: solid;
    border-width: 10px;
}

.blue {
    border-color: #0180C3;
    top: 0;
    left: 0;
    z-index: 0;
}

.yellow {
    border-color: #FEB131;
    left: 70px;
    top: 60px;
}

.yellow1 {
    /* On the blue ring */
    z-index: 1;
    /* Cutting circle */
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}


.yellow2 {
    /* Under the blue ring */
    z-index: -1;
    clip-path: polygon(0 0, 100% 100%, 100% 0);
}

Interlacing effect of rings explained

Take the blue and yellow rings as an example:
With the blue ring as the basis, the yellow ring is cut into two parts, the first part is above the blue ring, and the second part is below the blue ring.

Once you have finished drawing the blue and yellow rings, you can move on to the black ring. This time the benchmark becomes a yellow ring, and the black ring needs to be cut into two parts. Then there are the green and red rings, the same principle.

Complete code

https://jsbin.com/duhubis/edit?html,css,output

This is the end of this article about the sample code for implementing the Olympic Five Rings with pure HTML+CSS. For more relevant content about implementing the Olympic Five Rings with HTML+CSS, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future!

<<:  HTML+CSS to implement the sample code of the navigation bar drop-down menu

>>:  Pure HTML+CSS to achieve Element loading effect

Recommend

Detailed explanation of mysql5.6 master-slave setup and asynchronous issues

Table of contents 1. MySQL master-slave replicati...

Vue 2.0 Basics in Detail

Table of contents 1. Features 2. Examples 3. Opti...

How to create an index on a join table in MySQL

This article introduces how to create an index on...

A brief analysis of the knowledge points of exporting and importing MySQL data

Often, we may need to export local database data ...

Example code of javascript select all/unselect all operation in html

Copy code The code is as follows: <html> &l...

Detailed explanation of mysql backup and recovery

Preface: The previous articles introduced the usa...

Web designer is a suitable talent

<br />There is no road in the world. When mo...

How to view and close background running programs in Linux

1. Run the .sh file You can run it directly using...

How to enable the slow query log function in MySQL

The MySQL slow query log is very useful for track...

How to choose the format when using binlog in MySQL

Table of contents 1. Three modes of binlog 1.Stat...

Example code for drawing double arrows in CSS common styles

1. Multiple calls to single arrow Once a single a...