Skip to main content
added 362 characters in body; edited tags
Source Link
Temani Afif
  • 280k
  • 30
  • 378
  • 503

I am trying to round the top & bottom edges of this polygon to be the same as the icon. Does somebody know what I am doing wrong?

<div class="activity__icon">
<i class="fas fa-play-circle"></i>
</div>

.activity{
  max-width: 200px;
  &__icon {
  border-right-radius: 50%;
  text-align: center;
  background-color: #eee;
  clip-path: polygon(50% 20%, 100% 50%, 50% 80%, 0% 50%);
  margin: 0 auto;
  padding: 2rem;
  i {
    color: #707070;
    border: 2px solid #707070;
    border-radius: 50%;
    max-width: fit-content;
    padding: 15px;
    font-size: 25px;
    text-align: center;
    vertical-align: middle;
  }
}
}

.activity {
  max-width: 200px;
}
.activity__icon {
  border-right-radius: 50%;
  text-align: center;
  background-color: #eee;
  clip-path: polygon(50% 20%, 100% 50%, 50% 80%, 0% 50%);
  margin: 0 auto;
  padding: 2rem;
}
.activity__icon i {
  color: #707070;
  border: 2px solid #707070;
  border-radius: 50%;
  max-width: fit-content;
  padding: 15px;
  font-size: 25px;
  text-align: center;
  vertical-align: middle;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<div class="activity"> 
<div class="activity__icon">
<i class="fas fa-play-circle"></i>
</div>

https://codepen.io/avashavash/pen/OJRPJNL

I am trying to round the top & bottom edges of this polygon to be the same as the icon. Does somebody know what I am doing wrong?

<div class="activity__icon">
<i class="fas fa-play-circle"></i>
</div>

.activity{
  max-width: 200px;
  &__icon {
  border-right-radius: 50%;
  text-align: center;
  background-color: #eee;
  clip-path: polygon(50% 20%, 100% 50%, 50% 80%, 0% 50%);
  margin: 0 auto;
  padding: 2rem;
  i {
    color: #707070;
    border: 2px solid #707070;
    border-radius: 50%;
    max-width: fit-content;
    padding: 15px;
    font-size: 25px;
    text-align: center;
    vertical-align: middle;
  }
}
}

https://codepen.io/avashavash/pen/OJRPJNL

I am trying to round the top & bottom edges of this polygon to be the same as the icon. Does somebody know what I am doing wrong?

.activity {
  max-width: 200px;
}
.activity__icon {
  border-right-radius: 50%;
  text-align: center;
  background-color: #eee;
  clip-path: polygon(50% 20%, 100% 50%, 50% 80%, 0% 50%);
  margin: 0 auto;
  padding: 2rem;
}
.activity__icon i {
  color: #707070;
  border: 2px solid #707070;
  border-radius: 50%;
  max-width: fit-content;
  padding: 15px;
  font-size: 25px;
  text-align: center;
  vertical-align: middle;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<div class="activity"> 
<div class="activity__icon">
<i class="fas fa-play-circle"></i>
</div>

https://codepen.io/avashavash/pen/OJRPJNL

Source Link

CSS: clip-path: polygon - rounded-borders

I am trying to round the top & bottom edges of this polygon to be the same as the icon. Does somebody know what I am doing wrong?

<div class="activity__icon">
<i class="fas fa-play-circle"></i>
</div>

.activity{
  max-width: 200px;
  &__icon {
  border-right-radius: 50%;
  text-align: center;
  background-color: #eee;
  clip-path: polygon(50% 20%, 100% 50%, 50% 80%, 0% 50%);
  margin: 0 auto;
  padding: 2rem;
  i {
    color: #707070;
    border: 2px solid #707070;
    border-radius: 50%;
    max-width: fit-content;
    padding: 15px;
    font-size: 25px;
    text-align: center;
    vertical-align: middle;
  }
}
}

https://codepen.io/avashavash/pen/OJRPJNL