使用 CSS 选择器选择 id 为“tutorials”的元素
若要选择所有 id 为“tutorials”的元素,你可以尝试运行以下代码。
使用 #id CSS 选择器来实现此目的,
示例
<!DOCTYPE html>
<html>
<head>
<style>
#tutorials {
border: 3px solid red;
}
</style>
</head>
<body>
<h1>Tutorialspoint</h1>
<h2>Learning</h2>
<p id = "tutorials">Tutorials on web dev, programming, database, networking, etc.</p>
<p>Every tutorials has lessons with illustrations and figures.</p>
</body>
</html>
广告
数据结构
网络
关系型数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP