05 – СSS селекторы – Селектор по слову внутри атрибута

It happens that attribute elements contain several words at once. To find such elements, one of the words separated by spaces inside the attribute, use a selector with a tilde sign. Create four blocks with title attributes such that each attribute has three words. The first word would be just a div, the second word is a div with a block number, and the third word would be just some. To find the third block, we write the selector title ~=div3, and we immediately colored the third block And the thing is that inside it there is exactly the word div3, but if we want to color all the blocks and indicate the word some, then instead of div3, it is enough to change the designation to some and we will paint all the elements. I hope you enjoyed this video! If so, then like it! Happy development and all the best!

Add a Comment

Your email address will not be published. Required fields are marked *