How to fix HTML span align center not working?

Spread the love

Sometimes, we want to fix HTML span align center not working.

In this article, we’ll look at how to fix HTML span align center not working.

How to fix HTML span align center not working?

To fix HTML span align center not working, we set the text-align property.

For instance, we write

<div style="text-align: center">
  <span style="border: 1px solid red">
    This is some text in a div element!
  </span>
</div>

to add text-align: center on the div to center align the span.

Conclusion

To fix HTML span align center not working, we set the text-align property.

Leave a Reply

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