Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,895 questions

51,826 answers

573 users

How to position the items in the grid anywhere you want in CSS

1 Answer

0 votes
<!DOCTYPE html> 
<html> 
    <head> 
        <style>
            .grid-container {
                display: grid;
                grid-gap: 10px;
                grid-template-columns: auto auto auto;
                background-color: blue;
                padding: 10px;
            }
            .grid-container > div {
                background-color: lightblue;
                border: 1px solid;
                padding: 15px;
            }
            /* grid-item1 start with row line 1 column line 3 
                        and end with row line 2 column line 4 */
            .grid-item1 { grid-area: 1 / 3 / 2 / 4; }
            .grid-item2 { grid-area: 1 / 2 / 1 / 3; }
            .grid-item3 { grid-area: 1 / 1 / 2 / 2; }
            .grid-item4 { grid-area: 2 / 1 / 3 / 2; }
            .grid-item5 { grid-area: 2 / 2 / 3 / 3; }
            .grid-item5 { grid-area: 2 / 3 / 3 / 4; }
        </style>
    </head> 
    <body> 
        <div class="grid-container">
            <div class="grid-item1">a</div>
            <div class="grid-item2">b</div>
            <div class="grid-item3">c</div> 
            <div class="grid-item4">d</div>
            <div class="grid-item5">e</div>            
            <div class="grid-item6">f</div>
        </div>
    </body> 
</html>

 



answered Jun 4, 2019 by avibootz

Related questions

2 answers 287 views
1 answer 225 views
225 views asked Jan 7, 2021 by avibootz
1 answer 253 views
5 answers 498 views
...