Kaan Demir
Kaan Demir

Reputation: 472

Html Profil Card align right

I don't understand where I made a mistake, I want this round logo on the right. and I want the header below, but where's my fault?

If we briefly summarize the event, as shown in the pictures ..

<div class="video-clip mb-5">
<div class="clip-pic">
<img src="https://www.chiquita.com/wp-content/uploads/2019/12/Chiquita_Banana_Class_Extra_Yellow.jpg" alt="" width="">
</div>
<div class="clip-detail mt-2">
<div class="clip-logo">
<img src="https://www.chiquita.com/wp-content/uploads/2019/12/Chiquita_Banana_Class_Extra_Yellow.jpg" alt="" class="img-circle">
</div>
<div class="clip-desc">
<div class="clip-category">Category Title</div>
<div class="clip-title">Clip Title</div>
</div>
</div>
</div>
.video-clip {
    width: 305px;
    height: 265px;
}
.clip-pic img {
    width: 305px;
    height: 180px;
}
.clip-detail {
    background-color: black;
    display: flex;
    margin: 0;
    padding: 0;
}
.clip-logo {
width: 80px;
    height: 80px;
    overflow: hidden;
    border: 5px solid #0b75c9;
    position: relative;
    top: -50px;
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
}
.clip-desc {
    flex: 1;
    min-width: 1px;
    position: relative;
}

the image i want

enter image description here

i created

enter image description here

Upvotes: 0

Views: 36

Answers (1)

Alberto Rhuertas
Alberto Rhuertas

Reputation: 773

I made a quick remake. I hope this can help you.

.card {
  width: 300px;
  display: flex;
  flex-direction: column;
}

.card-pic img {
  width: 100%;
  height: 100%;
  max-height: 350px;
  object-fit: cover;
}


.card-info-logo {
  position: absolute;
  right: 22px;
  top: -22px;
}

.card-info-logo img {
  width: 40px;
  border-radius: 50%;
  border: 4px solid gray;
}
.card-info {
  position: relative;
  background-color: black;
  height: 100px;
  padding: 15px;
  display: flex;
  flex-direction: column;
}

.card-info-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card-info .title {
  color: lightgray;
  font-size: 14px;
}

.card-info .subtitle {
color: lightgray;
  font-size: 18px;
  padding-bottom: 10px;
}
.card-info-bottom {
  border-top: solid 1px white;
  padding-top: 10px;
  display: flex;
  align-items: center;
  line-height: 1;
  justify-content: space-between;
}
.card-info .card-info-bottom .views{
 color: lightgray;
  font-size: 12px;
  
}

.card-info .card-info-bottom .date {
 color: lightgray;
  font-size: 12px;
}
<div class="card">
<div class="card-pic">
  <img src="https://www.chiquita.com/wp-content/uploads/2019/12/Chiquita_Banana_Class_Extra_Yellow.jpg" alt="">
</div>  
  <div class="card-info">
    <div class="card-info-logo">
      <img src="https://www.chiquita.com/wp-content/uploads/2019/12/Chiquita_Banana_Class_Extra_Yellow.jpg">
    </div>
    <div class="card-info-top">
      <div class="title">This is a title</div>
    <div class="subtitle">This is a subtitle</div>
    </div>
    <div class="card-info-bottom">
      <div class="views">
        VIEWS 10K
      </div>
      <div class="date">
        yesterday
      </div>
    </div>
  </div>
  
</div>

Upvotes: 1

Related Questions