Jump to content

I seem to be having another problem


primefalcon
 Share

Recommended Posts

Ok in an external stylesheet I've tried to define the hyperlink colors same as I do in html bodyas follows

body {background-image: url('black');background-attachment: fixed;a:link {color: #FF0000}a:visited {color: #00FF00}a:hover {color: #FF00FF}a:active {color: #0000FF}}

the actual first alink isn't actually working right and I've I've tried using a separate body just for the link selectors but.... cant get it to work. IS what I'm trying to do possible?sorry to be a pain just in the middle of converting one of my websites over to css and most of it is going great

Link to comment
Share on other sites

no need to put the link styles in the body selector. instead try:

body {background-image:url('black'); background-attachment: fixed;}a:link {color: #FF0000}a:visited {color: #00FF00}a:hover {color: #FF00FF}a:active {color: #0000FF}

Link to comment
Share on other sites

no need to put the link styles in the body selector. instead try:
body {background-image:url('black'); background-attachment: fixed;}a:link {color: #FF0000}a:visited {color: #00FF00}a:hover {color: #FF00FF}a:active {color: #0000FF}

so the thing itself acts as the selector, thank you..ok that works, but is there anyway to actually do it so you cal select classes with this? or would I have to do that in a separate stylesheet
Link to comment
Share on other sites

Are you asking about CSS class for <a>, you can write css classes in the same stylesheet.....CSS:a.classname:link {color: #ff0000}a.classname:active {color: #0000FF}a.classname:visited {color: #00FF00}a.classname:hover {color: #FF00FF}HTML: <a href="someurl" class="classname">Link 1</a>Example:http://www.w3schools.com/css/tryit.asp?filename=trycss_link2

Link to comment
Share on other sites

Ok that is exactly what I need to know, thank you very much.and I actually seen that example but I didn't draw the connectionso say doing this would be no problemCSS:a.main:link {color: #ff0000}a.homelink:link {color: #ff0000}HTML:<a href="someurl" class="main">say page 2</a> <a href="someurl" class="homelink">home</a>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...