Thursday, May 20, 2021

How to make same div height and width for all products

 I have a list of products coming from the graphql query. It has images of different dimensions and title of different length. I am not able to make all the images same height and width and dimension of the div containing image and title of equal dimensions. I have tried the below code but not able to find the solution

 display: flex;
 flex-direction: column; 
 max-width: 100%; 
 max-height: 100%;
 width: 50px; 
 height: 50px;
-webkit-transform-origin: 0 0;

 <div className="BrandData_Block" key={brand.value}>
     <a href="" className="BrandData_Url">
        <div className="BrandData_ImageWrapper">
               <img className="BrandData_Image" src={brand.image} alt={brand.value} />
                <p className="BrandData_Title">{brand.value}</p> 

        background: #FFFFFF 0% 0% no-repeat padding-box;
        border: 1px solid #D0D0D0;
        margin: 30px;
        padding: 30px;
        width: 194px;
        height: 145px;
        border-radius: 5px;
        color: black;
        text-align: center;
        font-size: 16px;
        margin: auto;
        display: block;

This is the output I am getting in this image and i want to display the products like this image

No comments:

Post a Comment

5 Best Multipurpose Website Templates

 POSTED  JANUARY 20, 2020   LANA MIRO Looking for a splendid website template? You got to the right place! In this collection, you will find...