HTML CSS examples for CSS Layout:Flex Item
Padding a flex item
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> body > div { height: 50px; display: flex; } body > div > div { flex: 1;<!-- ww w. j av a 2 s . c om--> box-sizing: border-box; } #a { background-color: red; } #b { background-color: green; } #c { padding: 10px; background-color: blue; } #d { background-color: yellow; </style> </head> <body> <div> <div id="a"></div> <div id="b"></div> </div> <div> <div id="c"></div> <div id="d"></div> </div> </body> </html>