Creating Inline Spans
Part of the problem with replacing
the old style tags like <b>, <i>, and <ins> with styles for
individual items is that the style= argument must be placed within
an existing tag. For example, in the following sentence, how would you avoid using
<b> to make only one word bold?
<p>I had a <b>great</b> time.</p>
The word great does not have any container tags that surround
it alone, so there’s no place to put a style= argument. The
solution is to use an inline
span. A span is simply a shell into which you can place any arguments
you need. For example, the preceding example could be written as follows to use a
style:
<p>I had a <span style="text-weight: bold">great</span> time.</p>
That’s an awful lot of typing, but there’s a good ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access