Toggle navigation
☰
HTML
CSS
Scripting
Database
<!DOCTYPE html> <title>My Example</title> <style> .exp-container { background-color: #f8f9fa; border: 1px solid #dee2e6; padding: 20px; border-radius: 8px; font-family: sans-serif; /* We define a base width to multiply our exponential result by */ --base-width: 15px; } .exp-bar { background-color: #0dcaf0; color: #000; font-weight: bold; height: 40px; margin-bottom: 10px; display: flex; align-items: center; padding-left: 10px; border-radius: 4px; white-space: nowrap; /* Calculate the width: Base Width * e^(var(--val)) */ width: calc(var(--base-width) * exp(var(--val))); } .exp-bar:last-child { margin-bottom: 0; } /* Assign a simple sequential number to each bar */ .bar-1 { --val: 0; } .bar-2 { --val: 1; background-color: #0bacce; color: white; } .bar-3 { --val: 2; background-color: #088da8; color: white; } .bar-4 { --val: 3; background-color: #056e82; color: white; } </style> <div class="exp-container"> <div class="exp-bar bar-1">exp(0)</div> <div class="exp-bar bar-2">exp(1)</div> <div class="exp-bar bar-3">exp(2)</div> <div class="exp-bar bar-4">exp(3)</div> </div>