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 7 of 7

Thread: CSS Help.

  1. #1
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts

    CSS Help.

    I'm really new to CSS and for some reason
    Code:
    a{font-family: "Arial", "Veranda", sans-serif;
    	color:white;
    	font-size:14px;
    	text-align:center;
    }
    the "text-align:center;" attribute doesn;t work. I have 3 other things where it does. Any help is appreciated.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    we need to see the html, but if you want all of the text to center, put that the text-align:center; in the body tag

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Your text-align won't work because you are aplying it into a inline element.

  • #4
    Senior Coder chilipie's Avatar
    Join Date
    Jul 2004
    Location
    Shrewsbury, UK Age: 16
    Posts
    1,117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ^ What he said.

    If you want a elements to align center, do this:
    Code:
    a {
    display: block;
    text-align: center;
    }
    Please use a more descriptive post title next time .

  • #5
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I got help last night, but thanks anyways.

    I do, however, have another problem.

    On all my other pages, the
    Code:
    a:hover{text-decoration:underline;}
    works, but not on this page. Here's the HTML.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>Spiders Eat Babies Is The Best Band Ever</TITLE>
    
    <style type="text/css">
    p{font-family:"Arial", sans-serif;
    	font-size:15px;
    	font-weight:100;
    	text-align:center;
    	color:white;
    	margin-bottom:100px;
    }
    
    A{text-decoration:none;
    	color:#FFFFFF;
    	font-family:"Arial", sans-serif;
    }		
    A:hover{text-decoration: underline;
      cursor:crosshair;
    	color:#FFFFFF;
    }
    A:active{color:green;
    				text-decoration:none;
    }	
    A:visited{text-decoration:none;
    	color:#FFFFFF;
    }	
    
    body{background:#000000;
    }
    
    p.image{text-align:center;}
    
    p.link{font-size:15px;			
    }
    
    </style>
    </HEAD>
    <BODY>
    
    
    <p class="image"><img src="images/music.jpg" alt="Music12!#" /></p>
    <p>Pick an album...</p>
    
    
    Spiders Eat Babies.<br />
    <p class="image"><A HREF="seb.html"><IMG alt="spiderseatbabies (8K)" src="images/spiderseatbabies.JPG"
    height="28" width="460" /></A></p>
    
    
    Zombies vs. Ghost Pirates vs. Dinosaurs<br />
    <p class="image"><A HREF="nu.html"><img src="images/nu.jpg" alt="Who Will Win?!" /></a></p>
    
    <p class="link"><A HREF="index.html">Home...</A></p>
    
    
    <p class="link"><A HREF="band.html">Meet the band</A></p>
    
    </BODY>
    </HTML>

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    they go in a certain order
    a
    a:link
    a:visited
    a:hover
    a:active

    you need all of them most of the time some browsers stutter a bit, like IE
    Code:
    a {
    text-decoration:none;
    color:#FFFFFF;
    font-family:arial, sans-serif;
    }
    a:link {
    text-decoration:none;
    color:#FFFFFF;
    }
    a:visited {
    text-decoration:none;
    color:#FFFFFF;
    }	
    a:hover {
    text-decoration: underline;
    cursor:crosshair;
    color:#FFFFFF;
    }
    a:active{
    color:green;
    text-decoration:none;
    }
    you only need quotes around a font name when the font name is more than one word

  • #7
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks.


  •  

    Posting Permissions

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