Я впервые пытаюсь использовать flexbox, чтобы поместить текст рядом с изображением. У меня 4 div внутри .flex-container
: 1. изображение 2. название 3. кнопка 4. текст. Проблема только в 4-х текстовых. Почему-то это не работает идеально, как вы можете видеть на экране, потому что текст размещается под изображением.
html:
<div class="details-section">
<div class="container-fluid">
<div class="flex-container">
<div>
<img src="{{ product.image }}"
class="details-img">
</div>
<div class="details-title"> {{ product.name }} </div>
<div class="details-price-button">{{ product.price }} PLN
<button (click)="addToCart()"
class="btn btn-secondary btn-sm">Add to cart
</button>
</div>
<div class="details-description">{{ product.details }}</div>
</div>
</div>
</div>
css:
.flex-container{
padding-top: 40px;
display: flex;
flex-wrap: wrap;
}
.details-section {
margin-top: 60px
}
.details-title {
padding-left: 400px;
font-size: 25px;
font-weight: 600;
text-align: center;
height: 100px;
}
.details-price-button{
margin-left: 150px;
margin-top: 5px;
float: right;
font-weight: 500;
height: 100px;
}
.details-img {
border-radius: 8px;
}
.details-description {
margin-left: 450px;
margin-bottom: 200px;
padding-bottom: 200px;
height: 200px;
}