Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to center a link using CSS

I am very new and was messing around with some code ( just HTML and CSS ) But I can't get my link to center like my text? The id's are just for practice I know They aren't required.

http://pastebin.com/kYyR6WUx

like image 573
Isaiah Young Avatar asked Jan 13 '23 22:01

Isaiah Young


1 Answers

I provided a solution with css. You could take a look at this link http://jsfiddle.net/qPAfK/

div {
    width: 100px;
}

div a {
    text-align: center;
    display: block;
    margin: 0 auto;
}
like image 165
seanxiaoxiao Avatar answered Jan 16 '23 00:01

seanxiaoxiao