On Thu, Aug 11, 2016 at 11:46 AM, Andre "Osku" Schmidt
<andre.osku.schm...@gmail.com> wrote:
> #Hello.World,
>
> there seems to be no CSS pseudo-class that represents the element with an
> href matching the fragment identifier of the URI of the document. kinda
> like the source of :target [0].
>
> For example with :target we can style the element that has id="#foobar"
> when the browser URL is http://example.com/page.html#foobar, with :source
> we could style the element that has href="#foobar".
>
> I would like to easily style the link element in my table-of-content.
>
> So before i implement this with javascript, i thought to ask here:
>
> - Is there really no such pseudo-class?
> - Would this be technically impossible?
> - Has this been proposed before?
> - Any tips for proposing one? ;P
>
> Cheers
> Andre Schmidt


I accidentally replied off list with...

a[class="table-of-contents"]{
     color: red;
}

Google "Attribute Selectors"



But more in line with the OP's actual question:

a[href*="table-of-contents"]{
     color: red;
}


HTH


-- 

Tom Livingston | Senior Front End Developer | Media Logic |
ph: 518.456.3015x231 | fx: 518.456.4279 | medialogic.com


#663399
______________________________________________________________________
css-discuss [css-d@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to