Код: Выделить всё
body,
html,
#root {
margin: 0;
padding: 0;
height: 100%;
}
.product-card {
padding: 16px;
background-color: #f9f9f9;
border: 1px solid #ddd;
border-radius: 8px;
text-align: center;
margin: 10px;
}
.product-image {
max-width: 100%;
height: auto;
}
.slick-slider {
max-width: 800px;
margin: auto;
}
.slick-list {
overflow: visible;
}
.slick-slide {
display: flex;
justify-content: center;
align-items: center;
}
.res_home_container {
display: flex;
flex-direction: column;
width: auto;
height: 526px;
}
.res_image_container {
position: absolute;
display: inline-block;
height: 536px;
width: 100%;
}
.res_image_container::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #00000059;
z-index: 1;
}
.res_image_container img {
width: 100%;
display: block;
position: absolute;
z-index: 0;
}
.res_centered_div {
width: 585px;
height: 330px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
position: absolute;
display: grid;
justify-content: center;
align-items: center;
gap: 32px;
z-index: 2;
color: white;
border-radius: 8px;
}
.res_top_image {
width: 90rem;
height: 32.875rem;
top: -10px;
}
.res_title_container {
max-width: 583px;
height: 136px;
height: auto;
font-family: Grange;
font-size: 40px;
font-weight: 600;
line-height: 44px;
text-align: center;
gap: 16px;
display: inline-block;
word-wrap: break-word;
}
.res_text_container {
width: 563;
height: 131px;
font-family: Proxima Nova;
font-size: 16px;
font-weight: 400;
line-height: 24px;
text-align: center;
margin: 0 auto;
margin-top: 32px;
gap: 32px;
display: flex;
}
.retart_button {
width: 238px;
height: 47px;
padding: 14px 40px;
border-radius: 8px;
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
border: 1px solid #ffffff;
background-color: transparent;
}
.res_button_text {
width: 110px;
height: 19px;
font-family: Proxima Nova;
font-size: 16px;
font-weight: 500;
line-height: 19.49px;
text-align: center;
color: #ffffff;
}Код: Выделить всё
[img]/src/assets/result_page_img.jpg[/img]
Build you everyday self care routine.Perfect for if you're looking for soft, nourished skin, our moisturizing body washes are made with skin-natural nutrients that work with your skin to replenish moisture. With a light formula, the bubbly lather leaves your skin feeling cleansed and cared for. And by choosing relaxing fragrances you can add a moment of calm to the end of your day.[url=/]Retake the quiz[/url]Daily routinePerfect for if you're looking for soft, nourished skin, our moisturizing body washes are made with skin-natural nutrients that work with your skin to replenish moisture. With a light formula, the bubbly lather leaves your skin feeling cleansed and cared for. And by choosing relaxing fragrances you can add a moment of calm to the end of your day.
[img]https://cdn.shopify.com/s/files/1/0030/1989/8915/products/10-in-1_leave_in_moisturer.png?v=1695095354[/img]
A Tall Drink Of Water 10-In-1 Leave-In Moisturiser 150ML$27.95
[img]https://cdn.shopify.com/s/files/1/0030/1989/8915/products/New_Project.png?v=1597795136[/img]
Infusions Argan Oil & Hemp Seed Conditioner 473ml$24.95Несмотря на использование justify-content: center; и выровнять элементы: по центру; в .res_centered_div кнопка (retart_button) внутри него не идеально центрирована. Что мне здесь не хватает? Как я могу гарантировать, что кнопка будет центрирована как по вертикали, так и по горизонтали внутри контейнера?
Дополнительный контекст:
.res_centered_div позиционируется абсолютно так, чтобы достичь определенный макет.
Я пробовал регулировать поля и отступы в .retart_button, но, похоже, это не совсем идеально.
Обратите внимание, что кнопка не выравнивается. использует всю ширину контейнера.
Будем очень признательны за любые идеи и предложения! Спасибо.
Подробнее здесь: https://stackoverflow.com/questions/786 ... box-in-css
Мобильная версия