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