I want to make card style like this image using css but I can’t make this curved left side and how make image positioned like this
any help please !
curved image
I am trying to add border radius for this left side but not work like expected.
Edited
after apply trying some answers that was helpful
i get that result
result
and here html
<div class="card book" style="width:100%">
<div class="card-body">
<div class="row">
<div class="col-4">
<img src="{{ asset('books/images/img.png') }}">
</div>
<div class="col-8" style="padding-left:5px;">
<h5 class="card-title">title</h5>
<h6 class="card-text card-subtitle text-muted mb-2">substile </h6>
<ul class="nav book-table-info align-items-center">
<li class="nav-item">
<p>الصفحات</p>
<p>
<span class="numero">324</span>
</p>
</li>
<li class="nav-item">
<p>lang</p>
<p>
en
</p>
</li>
<li class="nav-item">
<p>size</p>
<p> MB <span class="numero">7.34</span></p>
</li>
</ul>
</div>
</div>
</div>
</div>
and here css
.book {
clip-path: polygon(150px 0, 100% 0, 100% 100%, 0 100%, 0 150px);
}
.book li:before {
content: '';
position: absolute;
left: -1rem;
top: 50%;
height: 20px;
background-color: #333;
width: 2px;
opacity: .5;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.book li {
margin-left: 2rem;
margin-bottom: 1rem;
position: relative;
}
.book p {
vertical-align: middle;
border: 0;
font-size: 12px;
text-align: center;
font-weight: 600;
position: relative;
}
.book img {
position: absolute;
top: -24px;
border: 1px solid #ede9e5;
max-width: 120px;
height: auto;
max-height: 200px;
}
now my problem is that image clipped too with card
2
Answers
You may check
clip-path
, also Clippy is a useful tool to create such a shape.You can use a
linear-gradient()
to create the shape:Positioning should be trivial then:
Try it: