Forum Moderators: not2easy

Message Too Old, No Replies

A:link inside a header and div

what's the secret?

         

wesg

7:21 pm on Sep 7, 2008 (gmt 0)

10+ Year Member



My Wordpress blog is going under the knife and I'm checking which colors work for the headers. My problem currently is that none of my visited links seem to correctly change, likely because I don't have the order correct.

Here is my Wordpress code:


<div class="post"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></div>

You'll see that the link is inside an h2 header, and .post div. What is the correct CSS markup so that links remain the same color regardless of being visited or not?

g1smd

7:27 pm on Sep 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is the the only item on the page that uses this selector?

div.post h2 a { ... }

If it is, then use that.

wesg

7:47 pm on Sep 7, 2008 (gmt 0)

10+ Year Member



Thanks, g1,
your tip, in addition to my careless div class/ID classification was the cause. Fixed now!

g1smd

7:53 pm on Sep 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I love those "drill down" type selectors.

I use them a lot.

I don't see all that many other people using them.