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

How can I move the product text under the product photos? I am only using HTML and CSS. As soon as I change it away from Flex, the images get too big

How can I move the product info under the product pics?
I am only using HTML and CSS. As soon as I change it away from Flex, the images get too big.

Please see what it looks like in the picture below.

html

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

    <div id="newProductsBox">
    
        <img class="productPic" src="img.jpg" alt="blue beanie">
        <div class="productInfo">
          <p class="productName">Beanie blue</p>
          <p class="productPrice">29,99 €</p>
          <p class="NEWicon">NEW</p>
        </div>

        <img class="productPic" src="img.jpg" alt="brown beanie">
        <div class="productInfo">
          <p class="productName">Beanie brown</p>
          <p class="productPrice">29,99 €</p>
          <p class="NEWicon">NEW</p>
        </div>

        <img class="productPic" src="img.jpg" alt="green beanie">
        <div class="productInfo">
          <p class="productName">Beanie green</p>
          <p class="productPrice">29,99 €</p>
          <p class="NEWicon">NEW</p>   
        </div>

        <img class="productPic" src="img.jpg" alt="black beanie">
        <div class="productInfo">
          <p class="productName">Beanie black</p>
          <p class="productPrice">29,99 €</p>
          <p class="NEWicon">NEW</p>
        </div>

    </div>

css

#newProductsBox {
  display: inline-flex;
  width: 100%;
  height: 170px;
}

img {
  .productPic {
    width: 100%;
    height: 100%;
  }
}

what it looks like now...

>Solution :

Bring the picture into productInfo class.

like this way:

 <div class="productInfo">
        <img class="productPic" src="img.png" alt="blue beanie">
          <p class="productName">Beanie blue</p>
          <p class="productPrice">29,99 €</p>
          <p class="NEWicon">NEW</p>
 </div>
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