I am attempting to center align some links within my div, while also ensuring that the text of the links is aligned to the left.
However, I have been unsuccessful in achieving this. I can either align them to the left or center, but not both simultaneously.
Do you have any suggestions on how to accomplish this?
Here is a demonstration of what I am currently getting: http://jsfiddle.net/HRKN4/
This is the HTML code I am using:
<div class="container">
<h3>Title:</h3>
<div class="content">
<ul class="links">
<li> <a href="#">»» This link is bigger</a></li>
<li> <a href="#">»» Smaller 1</a></li>
<li> <a href="#">»» link 1</a></li>
</ul>
</div>
</div>
And this is the applicable CSS styling:
.container
{
text-align:center;
width:100%;
margin:0 auto 0 auto;
background:pink;
}
.content
{
width:100%;
height:300px;
}
.links
{
list-style-type:none;
margin:0 auto;
}
.links li a
{
text-decoration:none;
background:red;
color:#000;
margin-top:20px;
margin:0 auto;
}