Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8

Thread: Align an a tag

  1. #1
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts

    Align an a tag

    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?

    Code:
    #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;
    }

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello again quartzy,
    Got some markup to go along with that CSS?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    hi ecav, you have seen this before.

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

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    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

  • #6
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by quartzy View Post
    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 -
    Code:
    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 -
    Code:
    a#map {width: 120px; margin: 0 auto; line-height: 60px; display: block; text-align: right;}
    Adjust the width to suit.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    quartzy (02-24-2011)

  • #7
    Regular Coder
    Join Date
    May 2009
    Posts
    813
    Thanks
    123
    Thanked 24 Times in 24 Posts
    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.

  • #8
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by quartzy View Post
    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.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •