Skip to content Skip to sidebar Skip to footer

Style HTML Element Based On Its Title Using CSS

Is it possible to apply a style to an HTML element using only its title as a unique identifier? For example:

Solution 2:

Yes you can:

http://www.w3.org/TR/CSS2/selector.html#attribute-selectors

You would say A[title="MyTitle] I believe.


Solution 3:

What you are looking for is css attribute selectors:

http://www.w3.org/TR/CSS2/selector.html#attribute-selectors

a[title] { ... }


Solution 4:

CSS specifications identify a number of "selectors" that may help you here. For example, you could apply a rule such as the following:

.my_class a[title="MyTitle"]
{
   ...
}

You can see a detailed specification of CSS "selectors" here:

http://www.w3.org/TR/2001/CR-css3-selectors-20011113/


Post a Comment for "Style HTML Element Based On Its Title Using CSS"