views:

297

answers:

2

Have a hyperlink inside of a h1... like so:
<h1 id="site-name"><a href="blah">blah</a><h1>

I apply a sifr3 rule to the css: h1#site-name

then inside sifr3-rules.js i apply the following rules... "a": { "text-decoration": "none" }, "a:link": { "color": "#FF0000" }, "a:hover": { "color": "#00FF00", "text-decoration": "none" }

But i realized in my Drupal site, it automatically adds .active class to the hyperlink, and the default link color won't work (however unusually the hover works)...

How can I set the rule so something like "a.active": { "color": "#FF0000" } gets applied? [that does't do anything btw, but i thought maybe it would help it out]

A: 

you can do one of the following:

1- modify drupal's a.class rule to:

a.class {
  color:#f00;
}

this is in order to have a consistent website (all active links are red)

2- or you can override the CSS rule:

h1#site-name a.active {
  color:#f00;
}
  • make sure you include the js file after CSS files in order to override the rule.
Anas Toumeh
This is a question about sIFR, so this doesn't provide an answer.
Mark Wubben
A: 

I don't believe Flash lets you select links with a class name (a.active). Best bet is to put the active class on the h1 instead. You can then replace h1.active to do the different styling. Make sure to replace it before the other h1s though.

Mark Wubben
Hey Mark,seems like best solution... I'll try to do this. Only trouble is Drupal's theme system auto adds the .active class (plus other classes) to that hyperlink.Im going to look into re-theming lists so sifr can work with them better, probably via drupal's theme_menu_item() function as Im already using that theme override to add a parent <div> around the hyperlink so sifr can target the link (had to do this as targeting the parent <li> caused havoc if list had a sublist). Plus the .active class gets auto added to the site-header, so will need to look into retheming a few things
armyofda12mnkeys
I wonder how so many people are using siFR with Drupal if most drupal theme's add that .active (i think) and would add blue links to the page.Will update if i get it working.
armyofda12mnkeys
So I think I got a way for Drupal menu items to work well with sifr:Note my UPDATED comment: http://drupal.org/node/110599#comment-2240280I will test this further to see if it works.
armyofda12mnkeys
Someone came up with solution that drupal's Dynamic Rendering module doesn't set the a:link rule which would help situation instead of modifying all that code:Here is that:http://drupal.org/node/626624
armyofda12mnkeys