Web.QHMIT
.com
Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
Run
<!DOCTYPE html> <title>Example</title> <style> .outer-container { width: 300px; height: 200px; border: 1px solid black; display: flex; } .box { padding: 10px; font: 16px sans-serif; background: gold; color: white; flex: 1 1 200px; } .animated { background: yellowgreen; animation: myAnimation 1s ease 1s 5 alternate forwards; } @keyframes myAnimation { 100% { flex-shrink: 2; } } </style> <div class="outer-container"> <div class="box">Box 1</div> <div class="box animated">Box 2 (animated)</div> <div class="box">Box 3</div> </div>
Preview