1

This is my html code:

<ul class="price-card__feature-list">
                <li class="price-card__feature-item">500 GB Storage</li>
                <li class="price-card__feature-item">2 Users Allowed</li>
                <li class="price-card__feature-item">Send up to 3 GB</li>
</ul>

This is my scss code:

.price-card{
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 .1rem .4rem rgba(#333, 0.2);
    color: $col-txt-med;

    &__feature-list{
        list-style: none;
    }

    &__feature-item{
        display: block;
        width: 90%;
        font-weight: 600;
        margin: 0 auto; 
        padding: 2rem auto 2rem;
        border-bottom: 1px solid rgba(#666, .2);
    }
}

If compiled to css :


.price-card{
    padding: 2rem;
    border-radius: 5px;
    box-shadow: 0 .1rem .4rem rgba(#333, 0.2);
    color: $col-txt-med;   
}

.price-card__feature-list{
    list-style: none;
}

.price-card__feature-item{
        display: block;
        width: 90%;
        font-weight: 600;
        margin: 0 auto; 
        padding: 2rem auto 2rem;
        border-bottom: 1px solid rgba(#666, .2);
}

What I want is the effect in which every list item is followed by a line which looks like an hr element. I tried to achieve this using border property. But now I am facing trouble with padding.

Johannes
  • 64,305
  • 18
  • 73
  • 130
sarvu_don37
  • 53
  • 2
  • 6
  • Auto padding is not a thing. Your rule value is invalid. See https://stackoverflow.com/questions/18545587/how-to-make-paddingauto-work-in-css. – isherwood May 14 '20 at 15:45
  • Try `padding: 2rem 0;` for the list item. Use rgba(48, 48, 48, 0.2) as color. – bron May 14 '20 at 15:56

1 Answers1

1

Your padding and border settings contained invalid values ("auto" for padding and the hex color value for rgba in border-bottom)

.price-card {
  padding: 2rem;
  border-radius: 5px;
  box-shadow: 0 .1rem .4rem rgba(#333, 0.2);
  color: $col-txt-med;
}

.price-card__feature-list {
  list-style: none;
}

.price-card__feature-item {
  display: block;
  width: 90%;
  font-weight: 600;
  margin: 0 auto;
  padding: 2rem 0;
  border-bottom: 1px solid rgba(100,100,100, 0.2);
}
<ul class="price-card__feature-list">
  <li class="price-card__feature-item">500 GB Storage</li>
  <li class="price-card__feature-item">2 Users Allowed</li>
  <li class="price-card__feature-item">Send up to 3 GB</li>
</ul>
Johannes
  • 64,305
  • 18
  • 73
  • 130