Jump to content


How do you style a link


4 replies to this topic

#1 Bouzy210

    Jedi In Training

  • Members
  • PipPip
  • 434 posts
  • Gender:Male

Posted 15 February 2008 - 12:23 PM

So I pretty much always have problems when making web pages. I define basic link color and function in a body.css, but then when I have somthing like a footer link and I want it a differeent color I will give it a class with new link properties. The problem is that just messes up the body links and vice versa. What am I doing wrong?

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 15 February 2008 - 05:28 PM

Examples of exactly what you have done, how ever, i would suggest a different kind of selector.

i.e.
a {
	/* blah */
}

a:hover { /* blah */ }

#footer a {
   /* different blah */
}

<body>
<a href="#">foo</a>
<div id="footer">
	<a href="#">Differen't looking foo</a>
</div>
</body>
Something like that would change anything "a" inside of the #footer element to whatever you choose.

#3 Jacorre

    P2L Jedi

  • Members
  • PipPipPip
  • 824 posts
  • Gender:Male
  • Location:USA
  • Interests:Computers, Technology, Internet, Graphic/Web Design, Music, Soccer

Posted 17 February 2008 - 11:36 PM

Take a look at my tutorial on css navigation menus.

#4 Raiders

    Young Padawan

  • Members
  • Pip
  • 44 posts

Posted 20 March 2008 - 05:45 PM

View PostJacorre, on Feb 18 2008, 05:36 AM, said:

Take a look at my tutorial on css navigation menus.

That helped me, but can i use the attach the css way instead of typing it above head? Am going to be using it everywhere for the footerlinks.

#5 tjl30

    Young Padawan

  • Members
  • Pip
  • 67 posts
  • Gender:Male
  • Location:MA
  • Interests:Graphic Design, Website layouts, Website scripting, movie editing, animation, snowboarding, sculpture, and drawing.

Posted 20 March 2008 - 09:22 PM

Ya, linking to a style sheet (the attached way) is what you should be doing if you are going to be using it in more than one page, or if you just like to see your css on a different page.

If you do not wish to create a div just so to style a few links at the bottom you can also use a span, or inline style.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users