Forum Home
Press F1
 
Thread ID: 26126 2002-10-20 00:47:00 HTML A links Heather P (163) Press F1
Post ID Timestamp Content User
90960 2002-10-20 00:47:00 I am creating a web site using a styles sheet. Links, Vlinks, Alinks, Hover all work as expected BUT I have a problem.

The site has 3 colours - red, black, white. The menu bars are black, the background for content is white and red is used for headings, logos, buttons etc. Bold and very striking.

Now, if I use a link as red on a black background changing to white on hover it stands out brilliantly. The trouble comes with links in the contents. White on white is not a good look.

Has anyone any ideas on how to create 2 hovers for the 2 different backgrounds?
Heather P (163)
90961 2002-10-20 00:54:00 There's nothing quite like writing a problem down to solve it yourself!

a:hover{color: #336600;}
a:hover.white{color: #FFFFFF;}

<a href=".....">
<a class = "white" href="......">

It works!
Heather P (163)
90962 2002-10-20 01:21:00 different classes - my suggestion exactlt. Congrats on solving your own prob before even one reply

G P
Graham Petrie (449)
90963 2002-10-20 01:32:00 That's what I would have suggested as well :) well done LOL

Mike. :D
Mike (15)
90964 2002-10-20 01:37:00 Very good!

I was going to suggest something like that but since I only just learn CSS in the last week wasn't sure of the correct terms/names that you need . It was the "class" that I wasn't sure about .

CSS is the way to go these days, that's for sure . Am going to have to redo all my webpages once I figure out how to do a few more things .
Susan B (19)
90965 2002-10-20 01:42:00 I use css in ALL my pages as it is very easy, and is familiar to me as I have used styles in word ever since I learnt to use it. I am waiting for a little bit better browser support for css so I can do away with frames. Then I will be a happy boy.

G P
Graham Petrie (449)
90966 2002-10-20 03:15:00 FRAMES!?! Personally I hate the things. Most people make the menus too big so you end up squinting into a small part of the screen to see what you're reading. Then they "forget" that the window is smaller and dump a Word or pdf doc into it which entails scrolling.

There are also copyright issues - it is bad form to show someone else's pages within your frameset without permission.

Besides - ever tried to get a DHTML menu to work across a frameset? Did it a while ago and strongly regretted it. One day I'll rework the site....

I had tried with the above problem to create .white {...} then add it - <a class="white".....>. I suspect that didn't work as "hover" is an attribute of another attribute - a - rather than an element.
Heather P (163)
90967 2002-10-20 04:17:00 Heather see comments below:

> FRAMES!?! Personally I hate the things . Most people
> make the menus too big so you end up squinting into a
> small part of the screen to see what you're reading .
> Then they "forget" that the window is smaller and
> dump a Word or pdf doc into it which entails
> scrolling .

In some instances, yes, in others they can help fulfill some of the foundation principles in web design eg maintain navigation, etc . They have their uses provided they are used correctly .
>
> There are also copyright issues - it is bad form to
> show someone else's pages within your frameset
> without permission .
>
Have you not heard of target="_blank" or target="top"? of course you have, they only problem is, people forget to use it - I always use it when linking to pages other than my own .

> Besides - ever tried to get a DHTML menu to work
> across a frameset? Did it a while ago and strongly
> regretted it . One day I'll rework the site . . . .

Again, they have their uses, but are not always appropriate .

> I had tried with the above problem to create . white
> { . . . } then add it - <a class="white" . . . . . > . I
> suspect that didn't work as "hover" is an attribute
> of another attribute - a - rather than an element .
>
>
>

was it in the form a . white:hover . . . ??? The class comes before the attribute .

CSS is marvelous, and when used to emulate frames, it will have huge benefits over frames - it removes almost all of the shortcomings . problem at the moment is browser support .

G P
Graham Petrie (449)
90968 2002-10-20 04:30:00 >>> problem at the moment is browser support.

Do you know exactly which browsers don't support CSS? I've tried looking for some details but haven't found anything that says specifically which.
Susan B (19)
90969 2002-10-20 04:33:00 >>was it in the form a.white:hover...??? The class comes before the attribute.

Actually no. I'd just set it up as a class on it's own. a:hover.white works though. Will go and have a play.

The way round frames - server side includes. Wonderful things. One place to make the changes for all pages. Add in CSS and sites are far more maintainable. Just need a ColdFusion or ASP engine to make it work.

I've used frames a few times but really consider that only one - a template for single page sites - actually benefited from them. (Have made a dozen or so sites off this template). The menu on the left navigates to "a names" on the page.
Heather P (163)
1 2