centralize "a" elements in a div

Asked

Viewed 55 times

0

How do I center a "a" link horizontally and vertically in the center of a div?

 <div id="header_right">
    <a>A</a>
    <a>B</a>
    <a>C</a>
 </div>

CSS:

#header_right {
    width: 342px;
    background: yellow;
}

2 answers

1

Add to css:

text-align: center;
vertical-align: middle;
  • True, I edited the answer to add the vertical.

0

<div id="header_right">
 <table width="100%" height="100%">
     <tr valing="middle" align="center">
         <td><a>A</a></td>
         <td><a>B</a></td>
         <td><a>C</a></td>
     </tr>
 </table>
 </div>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.