1

I wanna put a span within an a tag that covers all the same space(I mean the span with same space(width and height) of tag)

<a class="a-tab">
   <span class="fa fa-fw fa-plus">
</a>

.a-tab{
     float: none;
     display: inline-block;
     color: #333333;
     padding: 0.571em 1em;
     font-weight: 700;
}

.fa-fw{
    width: 1.28571429em;
    text-align: center;
}

.fa {
    display: inline-block;
    font: normal normal normal 14px/1 FontAwesome;
    font-size: inherit;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;

 }

so the problem is that I can't change the tag because it's from a lib and the fa plus icon. The only thing I can change is the <span>, maybe with a <div>. But it seems doesn't work. I tried to put a width: 100% and height: 100% but still not works.

Any suggestions?

travis_911
  • 301
  • 7
  • 19

1 Answers1

2

Try adding these styles:

a.a-tab {
    position: relative !important;
}

a.a-tab span {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
}
Sergej
  • 2,030
  • 1
  • 18
  • 28
  • I did not tell anything about padding. – Sergej Apr 23 '20 at 09:17