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:
attribute selectors; these are part of CSS2. In your particular case, you'd use:
div.my_classa[title="MyTitle"] { color: red; }
You can read more about attribute selectors here: http://www.w3.org/TR/CSS2/selector.html#attribute-selectors
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_classa[title="MyTitle"]
{
...
}
You can see a detailed specification of CSS "selectors" here:
Post a Comment for "Style Html Element Based On Its Title Using Css"