[attribute ~="value"] 선택기를 사용하여 CSS로 지정된 단어를 포함하는 속성 값을 가진 요소를 선택하십시오.
다음 코드를 실행하여 [attribute ~="value"] 선택기를 구현할 수 있습니다. 여기에서 우리가 검색하는 단어는 "튜토리얼입니다. ",
예시
<!DOCTYPE html>
<html>
<head>
<style>
[alt ~= Tutorials] {
border: 5px solid orange;
border-radius: 5px;
}
</style>
</head>
<body>
<img src = "https://www.tutorialspoint.com/videotutorials/images/tutor_connect_home.jpg" height = "200" width = "200" alt = "Tutor Connect">
<img src = "https://www.tutorialspoint.com/videotutorials/images/tutorial_library_home.jpg" height = "200" width = "200" alt = "Tutorials Library">
</body>
</html>