Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why isnt my html and css grid not working?

<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
        <style>
           
        </style>
    </head>
    <body>
        <div style="
        display: grid; 
        grid-template-columns: 100px, 100px;">
        <div style="background-color: lightblue;">div 1</div>
        <div style="background-color: lightpink;">div 2</div>
        </div>
    </body>
    </html>

I’ve been trying to make a grid in HTML and CSS and it’s not working. Im new to CSS and HTML so please tell me what I did wrong thanks!

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You should remove comma in grid-template-columns, write like this:

display: grid;

And

grid-template-columns: 100px 100px;

Also you can write like below and it’s better

grid-template-columns: auto auto;

See here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading