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