Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> .grey-container { display: grid; grid-template-columns: auto auto auto; grid-template-rows: auto auto; grid-auto-flow: column; grid-gap: 10px; background-color: #ccc; padding: 10px; } .grey-container > div { background-color: #eee; text-align: center; padding: 20px 0; font-size: 30px; } </style> </head> <body> <h2>Grid-auto-flow property example</h2> <h3>grid-auto-flow: column</h3> <div class="grey-container"> <div>1</div> <div>2</div> <div>3</div> <div>4</div> </div> </body> </html>