Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <style> .circle-container { position: relative; width: 250px; height: 250px; margin: 0 auto; border: 2px dashed #ccc; border-radius: 50%; display: flex; align-items: center; justify-content: center; background-color: #f8f9fa; /* Define the radius of our circular path */ --radius: 125px; } .center-dot { width: 20px; height: 20px; background-color: #343a40; border-radius: 50%; } .orbit-dot { position: absolute; width: 40px; height: 40px; background-color: #0d6efd; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: sans-serif; font-size: 0.8em; font-weight: bold; /* Calculate the X and Y positions using cos() and sin(). X = radius * cos(angle) Y = radius * sin(angle) */ --x: calc(var(--radius) * cos(var(--angle))); --y: calc(var(--radius) * sin(var(--angle))); /* Apply the calculated coordinates */ transform: translate(var(--x), var(--y)); } /* Assign a different angle to each dot */ .dot-1 { --angle: 0deg; } .dot-2 { --angle: 120deg; background-color: #198754; } .dot-3 { --angle: 240deg; background-color: #dc3545; } </style> <div class="circle-container"> <div class="center-dot"></div> <div class="orbit-dot dot-1">0°</div> <div class="orbit-dot dot-2">120°</div> <div class="orbit-dot dot-3">240°</div> </div>