1CSS doesn't work this way. As biziclop says in the comments, text nodes can't be selected with CSS. You'll either have to wrap your text in a <span> and use
2
3.test span {
4 cursor: pointer;
5}
6With
7
8<div class="test">
9 <span>Text</span>
10</div>
11Or set .test to display: inline, but that won't let you give it a width, which is not the behaviour you want. <span>s are fine, in this case.