使用[attribute|=”value”]選擇器來選擇具有以指定值開頭的指定屬性的元素。
您可以嘗試運行以下代碼來實現CSS [ attribute|=”value”] 選擇器,
示例
現場演示
<!DOCTYPE html>
<html>
<head>
<style>
[alt|=Tutor] {
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>
登錄后復制
以上就是使用 CSS 選擇 alt 屬性值以“Tutor”開頭的每個元素的詳細內容,更多請關注www.92cms.cn其它相關文章!






