HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

Chapter 30


ID


Contents


30.1 Fragment ID..................... 272
30.2 Cascading....................... 273

The one-character symbol for ID is#(hash), both in CSS and in the URL.


Exam Question 385(p.360): In CSS what is the one-character symbol
for ID?
Required Answer:#


It is used in the fragment ID, as the last part of a URL, to specify that part
of the webpage that should receive the focus.


It is used in CSS to indicated that a particular selector is an ID selector.


It is used in JavaScript to target specific elements for special treatment.


The ID itself must contain one or more characters, and none of them can be
a space character (space, cr, lf, ff).


The ID must be unique within the webpage.


30.1 Fragment ID


The fragment ID is the last part of a URL. It specifies that part of the web-
page that should receive the focus. Within the page, that part is identified
by havingid=something.


272

Free download pdf