From 218934fa2ed1c702a6d3923d2aa2cc6b43c48684 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:43:23 -0500 Subject: initial commit --- files/zh-tw/glossary/css_selector/index.html | 60 ++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 files/zh-tw/glossary/css_selector/index.html (limited to 'files/zh-tw/glossary/css_selector') diff --git a/files/zh-tw/glossary/css_selector/index.html b/files/zh-tw/glossary/css_selector/index.html new file mode 100644 index 0000000000..a22541284a --- /dev/null +++ b/files/zh-tw/glossary/css_selector/index.html @@ -0,0 +1,60 @@ +--- +title: CSS 選擇器 +slug: Glossary/CSS_Selector +tags: + - 樣式表 + - 超文本標記語言 + - 選擇器 +translation_of: Glossary/CSS_Selector +--- +

CSS 選擇器是 CSS 規則的一部分。它能讓你選定要調整哪個(或哪些)元素的樣式。例如:

+ +
***HTML***
+<div> I am inside of a div element. </div>
+<p> I am inside of a paragraph element. </p>
+
+
+***CSS***
+div {
+ color: green;
+}
+
+p {
+ color: red;
+}
+
+ +

在第一個 CSS 規則,我選取了 <div> 元素、並將該元素的文字變成了綠色。在第二個 CSS 規則,我選取了 <p> 元素、並將該元素的文字變成了紅色。結果應該長成這個樣子:

+ +

CSS 選擇器的結果

+ +

深入理解

+ +

基本知識

+ + + +

技術指南

+ +

{{SpecName("CSS3 Selectors")}}

-- cgit v1.2.3-54-g00ecf