Forum Moderators: not2easy

Message Too Old, No Replies

CSS first-letter pseudo element applied to anchor?

         

JAB Creations

7:32 am on Jul 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've tried applying the first-letter pseudo element to an anchor without success with Gecko 1.8, Opera 9, and IE7 B3. Anyone have success with this to any extent?

- John

Robin_reala

12:12 pm on Jul 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[w3.org ]
The :first-letter pseudo-element must select the first letter of the first line of a block

Unfortunately giving the <a> display:block; doesn't help either. There's quite a few open bugs [bugzilla.mozilla.org] on ::first-letter support in Gecko so it's probably one of those...

JAB Creations

1:14 pm on Jul 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for pointing that out Robin. It reminded me on a redesign of a friend's second site (almost done this morning) that when I was validating the accessibilities standards that I spotted WAI AAA requires that anchors not be next to each other inside the same block level element (more of less, just a loose interpretation). So....

<div class="menu">
<div><a href="#">...</a></div>
<div><a href="#">...</a></div>
<div><a href="#">...</a></div>
</div>

...may be able to apply first-letter to...

div.menu div:first-letter {}

...perhaps? I'll have to try this out and I'll post what I find in regards to cross-browser results.

- John

Robin_reala

2:14 pm on Jul 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah yeah, good old guideline 10.5 [w3.org] :) It's still good practise to separate links but these days they're generally marked up as lists. Non-link printable characters aren't as necessary (the 'Until user agents' clause is probably fufilled now).

(on a tangent, you know that triple-AAA is almost impossible to achieve and that automated accessibility checkers mean next to nothing, yeah?)

JAB Creations

7:53 pm on Jul 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I still like a challenge and occasional nap. I'll post what I get in a little while.

- John