I have put the images side by side successfully but it ends up with different sizes using flexbox
I'm hoping for some help which can display the image with same size in a same row.
CSS CODE
<style>
*{
margin:0;
padding: 0;
box-sizing: border-box;
}
.row{
padding-top: 50px;
display: flex;
align-items: center;
flex-wrap:wrap;
justify-content: space-around;
}
.product{
flex-basis:25%;
margin: 5px;
padding:5px;
max-width: 200px;
margin-bottom: 50px;
transition: transform 0.5s;
}
.product:hover {
transform: translateY(-5px);
}
.pro-con {
background-color: #3369FF;
}
.row>img{
height: 100%;
width:auto;
transition: transform 0.5s;
}
h2{
text-align: center;
}
p{
color:black;
text-align: center;
}
</style>
HTML
<body>
<h1 style="text-align: center">ALL PRODUCTS</h1>
<%
Class.forName("com.mysql.jdbc.Driver");
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/users", "root","123456767");
Statement stm = conn.createStatement();
ResultSet rs = stm.executeQuery("SELECT * FROM users.product\n");
int cnt = 1;
while(rs.next())
{
++ cnt;
if(cnt % 2 == 0)
{
%>
<div class="row">
<div class="product">
<div class="pro-con">
<a href="Bdetail.jsp?pid=<%=rs.getString("product_id")%>">
<img src="./ProductDisplayServlet?product_id=<%=rs.getString("product_id")%>"/>
</a>
<h2><%=rs.getString("product_name")%></h2>
<p><%=rs.getString("price")%></p>
</div>
</div>
<%
}
else {
%>
<div class="product">
<div class="pro-con">
<a href="Bdetail.jsp?pid=<%=rs.getString("product_id")%>">
<img src="./ProductDisplayServlet?product_id=<%=rs.getString("product_id")%>"/>
</a>
<h2><%=rs.getString("product_name")%></h2>
<p><%=rs.getString("price")%></p>
</div>
</div>
<%
}
</div>
}
%>
</body>
I'm hoping for any help as I'm hoping to display 4 images of different sizes in a row yet they can display in different sizes. Any tutorial or help would be much appreciated!