Reputation: 171
It works in all browsers except one. I want this div to be in the center of a page
<div style="padding-left: 800px;">
<a class="works-top" href="/page/1"></a>
<a class="free-top" href="/page/2"></a>
<a class="faq-top" href="/page/3"></a> </div>
Thats how I define it is in the css
a.free-top {
display:block;
cursor:pointer;
background:url(../img/free.png) no-repeat left top;
width:100px;
height:20px;
text-indent:-5000px;
margin-left:0px;
margin-top:0px;
margin-bottom:4px;
float:left;
}
Upvotes: 0
Views: 927
Reputation: 56509
A simple logic without introducing new code, try
<div style="padding-left: 50%;">
Upvotes: 1
Reputation: 10619
Instead of padding-left:800px;
on
<div style="padding-left: 800px;">
Use margin:0 auto; and width:1000px;
Remember that margin:0 auto;
works only if width is specified.
Upvotes: 5
Reputation: 21272
You can use margin: 0 auto;
in order to align your div at the center.
Upvotes: 2