使用 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