Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How do I style circles behind another element?

I am trying to figure out the best way to place these green circles behind another element that allows for the design to stay responsive.
Demo Here

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Something like this:

.background {
 background-color: black;
 height: 200px;
 width: 500px;
 margin: 30px;
 position: relative;
}

.background::before { 
 content: '';
 position: absolute;
 height: 50px;
 width: 50px;
 background-color: red;
 border-radius: 50%;
 top: 0;
 left: 0;
 display: block;
 transform: translate(-50%, -50%);
 z-index: -2;
}

.background::after { 
 content: '';
 position: absolute;
 height: 50px;
 width: 50px;
 background-color: red;
 border-radius: 50%;
 bottom: -47px;
 right: -47px;
 display: block;
 transform: translate(-50%, -50%);
 z-index: -2;
}
<div class="background"></div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading