Всем Привеи. В этом видео мы создадим дизайн карточки товара с перевернутым радиусом границы, используя HTML и CSS. Надеюсь, это видео будет для вас полезным. Скачать готовый код можно по ссылке ниже или нажав на кнопку "СКАЧАТЬ".
HTML КОД:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CSS Card Design</title>
<!--css file-->
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="card">
<div class="top"></div>
<div class="bottom">
<div class="content">
<h1>Card Title</h1>
<p>
Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas
minima modi vel voluptate odit atque voluptatem amet quia recusandae
sequi!
</p>
</div>
</div>
</div>
</body>
</html>
CSS КОД:
/* Google Fonts(Poppins) */
@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
* {
font-family: "Poppins", sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: #222;
}
.card {
width: 300px;
background: #fff;
overflow: hidden;
border-radius: 30px;
}
.top {
position: relative;
width: 100%;
height: 250px;
background: url(img.jpg) no-repeat;
background-size: cover;
background-position: center;
}
.bottom {
position: relative;
width: 100%;
margin-top: -40px;
}
.content {
z-index: 2;
position: relative;
padding: 20px;
}
.bottom::after,
.bottom::before {
position: absolute;
content: "";
width: 100%;
height: 40px;
z-index: 1;
}
.bottom::after {
background: #fff;
top: 0;
right: 0;
border-top-right-radius: 40px;
}
.bottom:before {
height: 80px;
width: 40px;
background: transparent;
bottom: 100%;
left: 0;
border-bottom-left-radius: 40px;
box-shadow: 0 40px 0 #fff;
}
Также если это видео оказалось для вас полезным, оставьте комментарий со своими мыслями или вопросами. Ваши отзывы помогают нам создавать более ценный контент.
0 Комментарии