PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, November 9, 2022

[FIXED] how to divide css grid like first column 50%, second column 50% and third column 100%?

 November 09, 2022     css, html     No comments   

Issue


    .main-dev {
        display: grid;
        grid-template-columns: 50% 50%;
    }

I want to arrange my grid into 50% 50% and 100% structures. I have attached the required output image.

Current output :

Grid in four box

Expected Output :

Grid device in 50% 50% and 100%


Solution

.item {
  border: 1px solid red;
  text-align: center;
  padding: 10px;
}

.main-dev {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 200px;
  border: solid red 1px;
}

.item3 {
  grid-column: 1 / 3;
  /* or grid-column: 1 / span 2 */
}
<div class="main-dev">
  <div class="item">1</div>
  <div class="item">2</div>
  <div class="item item3">3</div>



Answered By - Arman Ebrahimi
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing