Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Team

I cant seem to have or create spaces for my div classes, want to create a spaces between them. They currently tightly close to one another and they dont seem to look good for UI design.

What I have tried:

// Bootstrap div class
<div id="feauture-store">
  <div class="box py-4">
    <div class="container">
      <div class="row">
        <div class="col-md-9">
          <h2 class="mb-0">Discounted Deals</h2>
          <div class="container">
            <div class="row">
              <div class="col-md-6 text-center">
                <picture>
                  <source media="(min-width: 68px)" srcset="img/deal2.png">
                  <img src="img/deal2.png" alt="">
                </picture>
              </div>
              <div class="col-md-6 text-center">
                <picture>
                  <source media = "(min-width:68px)" srcset="img/deal3.png">
                  <img src="img/deal3.png" alt="">
                </picture>
                
              </div>
              
            </div>
          </div>
          </div>
        </div>
        </div>
        </div>
        </div>

CSS
// css style for div clas<pre>img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: 20px; /* add margin to create space between images */
}

@media (min-width: 768px) {
  picture {
    width: 100%;
    height: 100%;
  }
}
HTML

ses
Posted
Updated 11-Apr-23 0:10am

The bootstrap grid system is -pretty flexible see if this helps;

Grid system · Bootstrap[^]
 
Share this answer
 
Comments
Gcobani Mkontwana 11-Apr-23 6:09am    
@Mike Hankey thanksi had also tried something different by using css to achieve this peacefully.
Hi Team

I only applied the following logic to be able to achieve this without any issues.

picture {
  display: block;
  max-width: 100%;
  height: auto;
  margin-bottom: 20px; /* add margin to create space between pictures */
}

@media (min-width: 768px) {
  picture {
    width: 100%;
    height: 100%;
  }
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900