Style HTML element based on its title using CSS

前端 未结 5 1719
慢半拍i
慢半拍i 2021-01-08 01:33

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


      
5条回答
  •  醉梦人生
    2021-01-08 01:47

    Although it is possible, using attribute selectors (see http://www.w3.org/TR/CSS2/selector.html#attribute-selectors ) Internet Explorer 6 does not support it (see http://kimblim.dk/css-tests/selectors/ )

    An example from the W3C site: H1[title] { color: blue; }

提交回复
热议问题