THAM KHẢO MÃ CODE :
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
}
.container {
width: 100%;
max-width: 600px;
margin: 0 auto;
padding: 20px;
color: #333;
border-radius: 20px;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(15px) saturate(200%);
-webkit-backdrop-filter: blur(15px) saturate(200%);
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
border: 1px solid rgba(255, 255, 255, 0.18);
}
.product-card {
display: flex;
flex-direction: row; /* Đảm bảo các phần tử nằm ngang */
justify-content: space-between;
margin: 10px 0;
padding: 20px;
background: rgba(255, 255, 255, 0.2);
border-radius: 15px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: #333;
transition: transform 0.3s ease;
align-items: center;
}
.product-card:hover {
transform: translateY(-10px);
}
.product-image {
flex: 0 0 auto;
max-width: 100px;
margin-left: 20px; /* Đặt khoảng cách giữa hình ảnh và nội dung */
border-radius: 10px;
border: 1px solid #ddd;
}
.product-image img {
width: 100%;
height: auto;
border-radius: 10px;
}
.product-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
text-align: left;
}
.product-description {
margin-bottom: 10px;
}
.buy-button {
background-color: #56ab2f;
color: white;
border: none;
padding: 10px;
text-align: center;
border-radius: 5px;
cursor: pointer;
text-decoration: none;
font-weight: bold;
transition: background-color 0.3s ease;
margin-top: 10px;
align-self: flex-start;
}
.buy-button:hover {
background-color: #3b8b22;
}
@media (max-width: 600px) {
.product-card {
flex-direction: row; /* Đảm bảo rằng các phần tử vẫn nằm ngang */
align-items: flex-start;
}
.product-image {
max-width: 80px;
margin-left: 10px;
}
.product-info {
flex: 1;
}
.buy-button {
margin-top: 10px;
align-self: flex-start;
}
}
</style>
<div class="container">
<p>Nội dung bên trên Product card.</p>
<div class="product-card">
<div class="product-info">
<div class="product-description">
<h3>Sản phẩm ABC</h3>
<p>Mô tả sản phẩm</p>
</div>
<a href="#" class="buy-button">Mua Ngay</a>
</div>
<div class="product-image">
<img src="https://via.placeho
lder.com/150" alt="Product Image">
</div>
</div>
<p>Nội dung bên dưới Product Card</p>
</div>