...

View Full Version : Align an a tag



quartzy
02-24-2011, 01:16 AM
I have an a tag and some link. The problem is no matter wht I try I cannot shift it over to the right a bit. Can anyone help?


#footer {
width: 100%;
color: #fff;
clear: both;
height: 60px;
text-align: center;
background-image: url('../images/box_foot.jpg'); background-repeat: repeat-x;}

footer p {font-weight: bold;}


p.right {
width: 140px;
float: right;
padding: 0 .30em 0 0;
margin: 0 0 1em 0;
text-align: right;
overflow: hidden;}

a#map {
width: 120px;
float:right;
margin: 0 auto;
line-height: 60px;
display: inline;
text-align: center;
}

Excavator
02-24-2011, 01:34 AM
Hello again quartzy,
Got some markup to go along with that CSS?

quartzy
02-24-2011, 02:05 AM
hi ecav, you have seen this before.


<div id="footer">
<p class="right">
&copy; Seniors 2011</p>
<a href="../sitemap.html" id="map ">Site Map</a>
</div><!--footer-->

Excavator
02-24-2011, 02:15 AM
So is it to be centered with margin: 0 auto; or floated with float: right;? That is two different things you're doing to it.

Also,
<a href="../sitemap.html" id="map ">Site Map</a> is a lot different than
<a href="../sitemap.html" id="map">Site Map</a>

quartzy
02-24-2011, 02:28 AM
Hi again

I thought if I floated it to the right, it would sit over more. I have removed it now.

Also thanks for pointing out the error. Still does not sit in the middle though. www.seniors260.org

Excavator
02-24-2011, 02:51 AM
Hi again

I thought if I floated it to the right, it would sit over more. I have removed it now.

Also thanks for pointing out the error. Still does not sit in the middle though. www.seniors260.org

It will move all the way over if you float it right, you could use right margin to move it back toward center then if you like.

Try this -


a#map {width: 120px; margin: 0 250px 0 0; float: right; line-height: 60px; display: block; text-align: center;}
Adjust that right margin to suit.


Or this -

a#map {width: 120px; margin: 0 auto; line-height: 60px; display: block; text-align: right;}
Adjust the width to suit.

quartzy
02-24-2011, 03:20 AM
Tried the first option and it works now, it is just sits down on the second line but I can live with that. My mistake was to do margin 0 auto with the float right I think, as it would not budge before.

Excavator
02-24-2011, 09:47 AM
it is just sits down on the second line but I can live with that.

I'm not sure what you mean there. "Site Map" looks to be y centered in your 60px high #footer.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum