How do i center a link tag in a div


I have an a tag inside a div. I tried to center it with text-align, but it’s not working. How can i align it to the center?

Answer ( 1 )


    You need to add

    text-align: center;

    to the parent element, in your case to the div. Or you can use flexbox.

Leave an answer