HTML Compiler Online
Javascript Online Compiler
index.html
Change Theme
Compress code
Format code
Download Code
Clear Code
Copy Code!
RunĀ
ctrl+s or click
Output
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>CSS - flex grow</title> <style> .container { display: flex; border: 2px solid #bd1e60; width: 400px; margin: 20px 0; } #target1 { flex-grow: 2; background: #bd1e60; } #target2 { flex-grow: 1; background: #bd1e60; } #target3 { flex-grow: 0.5; background: #bd1e60; } .container div { margin: 1px; color: white; font-size: 18px; font-family: sans-serif; padding: 10px 15px; background-color: rgb(39, 170, 164); } </style> </head> <body> <h2>flex-grow: number</h2> <p>flex-grow set a flex grow factor to the item to set remaing size of container to the item.</p> <div class="container"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div> </div> <div class="container"> <div>1</div> <div>2</div> <div id="target1">3</div> <div>4</div> <div>5</div> </div> <div class="container"> <div>1</div> <div>2</div> <div id="target3">3</div> <div>4</div> <div>5</div> </div> <div class="container"> <div>1</div> <div>2</div> <div id="target1">3</div> <div id="target2">4</div> <div>5</div> </div> </body> </html>
RunĀ