Reply to Re: Easy CSS Question but I don't get it!!

Your name:

Reply:


Posted by John Salerno on 01/25/06 07:29

marksisson@gmail.com wrote:
> Can someone shed some light on why the below displays in green in my
> browser? Doesn't the anchor's class override its parent div tag's
> class???
>
> TEST.HTM
> ===================
> <html>
> <head>
> <link rel='stylesheet' href='TestStyles.css' type='text/css'>
> </head>
> <body>
> <div class='navmain'>
> <a class="navselected" href="abc.htm">Why not blue?</a>
> </div>
> </body>
> </html>
>
> TESTSTYLES.CSS
> ===================
> .navmain A { color: green; }
> .navselected { color: blue; }
>

Ok, I didn't read through this whole thread, so I don't know if an
answer has been given yet, but I thought this might be a fun exercise to
figure out. I think this would work, but is it a good idea to create
rules like this that basically conflict with each other (or are on equal
footing, and so must be decided based on their order), or is this how it
is often done?

..navmain a {color: green; }
a.navselected { color: blue; }

Of course, this assumes that .navselected is only attributed to <a>
elements, I think.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация