Which CSS selector targets an element by its id?
-
A
. (dot)
-
B
# (hash)
Correct answer
-
C
* (asterisk)
-
D
> (greater than)
Correct answer
B. # (hash)
17 views
Explanation
The # symbol targets an element by id. Source: Nabeel Academy, Chapter 3 MCQs (CSS section).
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ