Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a reference to id="xxx.yyy" in CSS?

Tags:

css

In the HTML code there is a div like:

<div id="xxx.yyy">...</div>

I want to specify the style in a css file. How can I get a reference to this div? The following does not seem to work:

#xxx.yyy {

}

Thanks

like image 484
znat Avatar asked Oct 03 '12 00:10

znat


Video Answer


2 Answers

#xxx\.yyy {

}

Should do the trick. No harm done in using dots in CSS id names

like image 157
Bruno Vieira Avatar answered Oct 05 '22 17:10

Bruno Vieira


You could also do something like this...

​div[id="xxx.yyy"] {
    /* your styles here */
}​​​​​​

The spec says it all: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier

jsFiddle: http://jsfiddle.net/UnsungHero97/mjGzQ/

like image 34
Hristo Avatar answered Oct 05 '22 17:10

Hristo