Click to See Complete Forum and Search --> : image not centering


jrthor2
04-22-2008, 08:58 AM
I have the below css that i am uing for an image rollover:

.rollover a {
display:block;
position: relative;
width: 100px;
height: 16px;
background: transparent url("cb_get_started2.png") 0 0 no-repeat;
text-decoration: none;
margin-top: 10px;
}
.rollover a:hover {
background-position: 0 -16px;
}
.rightTop {
background-color: #FDFFBE;
text-align: center;
margin-bottom: 47px;
padding: 10px;
}

And my code looks like this:

<div class="rightTop">
<h1>Not a member yet?</h1>
<p><strong>Create a new account.</strong></p>
<p>Membership is free. Sign up today.</p>
<div class="rollover">
<a href="registration.jsf?id=UEhPVHxGTEFTSHxUT0tFTjEyMzQ1Njc4OQ==" title="Get Started"> </a>
</div>
</div>

The problem is, is that the Heading and Text are centered, but the link is not in FireFox,
it's left aligned. How can I get the link centered in FireFox? IE seems to be fine, it centers
the link.

Thanks!

bathurst_guy
04-22-2008, 09:11 AM
give rollover a "margin: 0 auto;"

jrthor2
04-22-2008, 09:30 AM
ok, that centered the images in FireFox, but now I lost the 10px top margin on that link, so it's right up against the paragraph above it. also, in IE, I can't seem to get rid of the underline on these links.

thanks.

jrthor2
04-22-2008, 10:07 AM
I fixed the margin top issue, I just added a style for rollover;

.rollover {
margin-top: 10px;
}

But in IE, I still get the underline under my images, but I have text-decoration: none.

Thanks!

Centauri
04-22-2008, 07:22 PM
Try adding font-size:1px; to the .rollover a css - It could be that IE is not respecting the 16px height being set.