HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 18. RESPONSIVE WEB DESIGN (RWD) 195


Think of span as a generic form of bold or italic. Often it marks just a word
or two within a line or paragraph.


generally encloses a horizontal (linear) section of a webpage, such as
a few words. A span cannot include a div or a paragraph. It can, however,
include another span.


s can be nested.


Paragraphs cannot appear within a span, but spans can appear with a para-
graph, or within each other.


Exam Question 324(p.355):What HTML markup is used to mark off a
horizontal block of characters?
Acceptable Answer:...


Exam Question 325(p.355): In HTML what does the “span” tag stand
for?
Acceptable Answer:span


18.6.3 Nesting


By nesting divs, and varying the margin, border, and padding, you can
achieve a variety of stylistic effects.


One can insert divs and spans that are totally empty, and use them as
anchors for styling, such as the insertion of graphical elements for beauty or
branding. The graphics can be handled entirely within the CSS parts of the
webpage once the div or span is placed within the HTML.


Similarly, divs and spans, even empty ones, can be the target of JavaScript
actions, replacing them with new content as needed.


Exam Question 326(p.355): Can a div legally appear within another
div?
Required Answer:yes


Exam Question 327(p.355): Can a div legally appear within a p?
Required Answer:no


Exam Question 328(p.355): Can a div legally appear within a span?
Required Answer:no


Exam Question 329(p.355): Can a p legally appear within a div?

Free download pdf