Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Заголовок документа</title> <style> .grid-container { display: grid; grid-template-columns: auto auto auto; grid-template-rows: auto auto; grid-gap: 5px; background-color: #1c87c9; padding: 10px; } .grid-container > div { background-color: rgba(255, 255, 255, 0.8); text-align: center; padding: 20px 0; font-size: 20px; } </style> </head> <body> <h2>Пример свойства grid</h2> <div class="grid-container" style="grid-auto-flow: column;"> <div class="grid-box1">1</div> <div class="grid-box2">2</div> <div class="grid-box3">3</div> <div class="grid-box4">4</div> </div> </body> </html>