Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <style> .sqrt-container { background-color: #f8f9fa; border: 1px solid #dee2e6; padding: 40px; border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; gap: 30px; /* Define the base diameter for our shapes */ --base-size: 80px; } .sqrt-circle { background-color: #0d6efd; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: sans-serif; font-size: 0.85em; font-weight: bold; text-align: center; /* Calculate the width and height using sqrt(). We multiply the base size by the square root of our area multiplier. */ width: calc(var(--base-size) * sqrt(var(--area-multiplier))); height: calc(var(--base-size) * sqrt(var(--area-multiplier))); } /* The base circle (1x area) */ .circle-1x { --area-multiplier: 1; background-color: #6c757d; } /* The scaled circle (2x area) */ .circle-2x { --area-multiplier: 2; background-color: #0d6efd; } </style> <div class="sqrt-container"> <div class="sqrt-circle circle-1x">1x Area</div> <div class="sqrt-circle circle-2x">2x Area</div> </div>