Basic CSS question

L

Lee Davidson

I can't seem to get CSS to work for specific tags. I can when it is a
class alone, however. Here is the CSS in question:

A .blue
{
COLOR: blue;
TEXT-DECORATION: none
}
A A:visited
{
COLOR: blue;
TEXT-DECORATION: none
}
A A:hover
{
FONT-WEIGHT: bolder;
COLOR: green
}
A A:active
{
COLOR: blue;
TEXT-DECORATION: none
}

In the first case I want the link to be blue without an underline. In
the other cases, I want the link to change (hover) or not change
(visited and active same color). I had the last three as an inline
style (not in an .css file) and they worked, but now they don't as part
of the .css file.

Help.
 
D

David Dorward

Lee said:
I can't seem to get CSS to work for specific tags. I can when it is a
class alone, however. Here is the CSS in question:

A .blue

Applies to elements of .blue inside said:
A A:visited
A A:hover
A A:active

Applies to <a> elements with various pseudo-classes inside other <a>
elements. Invalid in HTML.
 
P

picayunish

When said:
I can't seem to get CSS to work for specific tags. I can when it is a
class alone, however. Here is the CSS in question:

A .blue
{
COLOR: blue;
TEXT-DECORATION: none
}
A A:visited
{
COLOR: blue;
TEXT-DECORATION: none
}
A A:hover
{
FONT-WEIGHT: bolder;
COLOR: green
}
A A:active
{
COLOR: blue;
TEXT-DECORATION: none
}

In the first case I want the link to be blue without an underline. In
the other cases, I want the link to change (hover) or not change
(visited and active same color). I had the last three as an inline
style (not in an .css file) and they worked, but now they don't as part
of the .css file.

Try this.
a.blue, a.blue:visited, a.blue:active {color: blue; background:
transparent; text-decoration: none;}
a.blue:hover {font-weight: bold; color: green; background: transparent;}
--
Edwin van der Vaart (Geen familie van....)
http://www.semi-conductors.nl/ PHP Redirect to semi-conductor.nl
http://www.semi-conductor.nl/ Links to Semiconductors sites
http://members.chello.nl/e.vandervaart/ Experimental site
http://host.deluxnetwork.com/~evdvaart/ Test site
 
B

brucie

L

Lee David

I'm not sure I'm following this. BTW, Interdev formats the .CSS and I
don't know how to get to the raw code to change anything.

What I'm after is in certain cases of <a> tags to have the text
unhighlighted and blue. This is a name tag jump so the viewer doesn't
need to see underlining or color switches on clicking the tag.

In the second case, I want the color to change as the mouse is moved
over a group of links, but no other changes to happen. This worked when
I was using a style sheet on the page, but I want to "graduate" to using
style sheets.

I'm not sure why the "A:" appears after the "A" tag, but are you saying
it should be like the "blue" class?

Tnanks,
Lee
 
L

Lee David

I didn't think of it in that way, that is as the visited and active as
subsets of "blue" which is a class associated with an "a" tag. I can't
get the blue to work by itself so adding the rest to it won't work until
I do.

Should there be that space between "A" and ".blue" or is that just
something that visual interdev is helpful to add?

Thanks,
Lee
 
L

Lee David

Thanks for your input. Unfortunately, my question was about syntax and
not style. If I can 't get the syntax down, then everything else is moot.

Any suggestions as to why the style isn't working will be greatly
appreciated.

Lee
 
B

Beauregard T. Shagnasty

Lee David pounced upon this pigeonhole and pronounced:
I'm not sure I'm following this. BTW, Interdev formats the .CSS and I
don't know how to get to the raw code to change anything.

Instead of just clicking the .css file to open it, right-click and choose
Open With... then pick the Source Code (Text) Editor

Set this editor as Default so the VI wizard thingy doesn't mess up your
structure after you repair it.
 
B

Bagbourne

Lee David said:
Thanks for your input. Unfortunately, my question was about syntax and
not style. If I can 't get the syntax down, then everything else is moot.

Any suggestions as to why the style isn't working will be greatly
appreciated.

Yes, but bolding things on hover is really horrible! It makes the links
wobble between bold and normal when your mouse moves over them, and pushes
the rest of any flowed content around as it does so. You can probably fix
this by giving them a "display:block" style and a fixed pixel width style if
you really want the bolding effect..

You have a problem with your selectors. Look at
http://www.htmlhelp.com/reference/css/structure.html

Nige
 
S

Sid Ismail

What I'm after is in certain cases of <a> tags to have the text
unhighlighted and blue. This is a name tag jump so the viewer doesn't
need to see underlining or color switches on clicking the tag.


CSS pseudo-classes

A.blue:visited {color: #003399;}
A.blue:link {color: #003399;}
A.blue:active {color: #003399;}
A.blue:hover {color: red;}

A.white:visited {color: #ffffff;}
A.white:link {color: #ffffff;}
A.white:active {color: #ffffff;}
A.white:hover {color: red;}

and then -

<a href="blah1.html" class="blue">Blue Link</a>
<a href="blah2.html" class="white">White Link</a>

Now play with text-decoration.

Sid
 
L

Lee David

Thanks for the suggestion. I removed the "bold" and am letting the
color speak for the highlighting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top