Search
 
SCRIPT & CODE EXAMPLE
 

CSS

css select text inside div

CSS 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

.test span {
    cursor: pointer;
}
With

<div class="test">
    <span>Text</span>
</div>
Or 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.
Comment

PREVIOUS NEXT
Code Example
Css :: estilos de button css 
Css :: Load hidden image to HTML 
Css :: animation left to right css 
Css :: cypress element css 
Css :: flex wrap tailwind 
Css :: for...in...loop 
Css :: nuxt page transition 
Css :: round corners of image css 
Css :: css linkup 
Css :: vertical divider between my flexbox 
Css :: sass variable 
Css :: details summary hide arrow 
Css :: backdrop filter all properties 
Css :: css button style rectangle 
Css :: what is em in css 
Css :: css class and id 
Css :: button material ui 
Css :: when change size image not change contrast css 
Css :: execution timeout expired the timeout 
Css :: float: down css 
Css :: media types in css 
Css :: css speak 
Css :: How to force fully show the keyboard in android 
Css :: css toggle switch 
Css :: css box-shadow over other elements 
Css :: css box shadow transform rotate 
Css :: css wavy line 
Css :: css box sizing 
Css :: indexes vs foreign key 
Css :: css display inline 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =