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

.BrandData_Block{
 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> 
         </div>  
      </a>   
  </div>



 .BrandData{
    
    &_Block{
        background: #FFFFFF 0% 0% no-repeat padding-box;
        border: 1px solid #D0D0D0;
        margin: 30px;
        padding: 30px;
        width: 194px;
        height: 145px;
        border-radius: 5px;
    }
    &_Title{
        color: black;
        text-align: center;
        font-size: 16px;
    }
    &_Image{
        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

8 Free Admin Templates to Try

 8 Free Admin Templates to Try 8 Free Admin Templates to Try Would you like to take off the burden of manually creating user interfaces for ...