How to vertically align something inside a span tag with CSS?

Spread the love

Sometimes, we want to vertically align something inside a span tag with CSS.

In this article, we’ll look at how to vertically align something inside a span tag with CSS.

How to vertically align something inside a span tag with CSS?

To vertically align something inside a span tag with CSS, we set the line height.

For instance, we write

span {
  line-height: 50px;
}

to set span elements’ line height to 50px with line-height: 50px;.

Conclusion

To vertically align something inside a span tag with CSS, we set the line height.

Leave a Reply

Your email address will not be published. Required fields are marked *