使用 CSS 选择其 href 属性值包含子字符串“java”的每个 <a> 元素
使用 [attribute*=”value”] 选择器选择其属性值包含指定值元素。
您可以尝试运行以下代码来实现 CSS [attribute*="value"] 选择器,
示例
<!DOCTYPE html>
<html>
<head>
<style>
[href* = java] {
border: 5px solid orange;
border-radius: 5px;
}
</style>
</head>
<body>
<a href = "https://tutorialspoint.com/php/index.htm">PHP Tutorial</a>
<a href = "https://tutorialspoint.com/java/index.htm">Java Tutorial</a>
</body>
</html>
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP