Saroj Thapa Saroj Thapa - 1 month ago 6
HTML Question

Why does PHPStorm report that padding isn't allowed on a span element?

I have the following html code. The PHPStorm says attribute padding is not allowed here. How can I quickly fix this?

<span style="padding:10px 0;"></span>

Answer

Padding works on inline-block and block level elements

or rather use a stylesheet:

.padded{
  display: inline-block;
  padding: 10px 0;
  background: navajowhite;
}
<span class="padded">I have a class!</span>