The Inline Element in html and its description
Many of the inline elements that have been around since the dawn of the Web were introduced
to change the visual formatting of text selections due to the lack of a style sheet system.
If you wanted bold ed-text, you marked it as b. Italics? Use the i element.
In fact, there was once a font element used solely to change the font, color, and size of text (the
horror!). Not surprisingly, HTML5 kicked the purely presentation font element to the curb.
However, many of the old-school presentation inline elements (for example, u for underline and s for strike-through)
have been kept in HTML5 and given new semantic definitions (b is now for “keywords,” s for “inaccurate text”).
Some inline elements are purely semantic (such as abbr or time) and don’t have default renderings.
For these, you’ll need to use a CSS rules if you want to change the way they display.
In the element descriptions in this section, I’ll provide both the definition of the inline
elements and the expected browser default rendering if there is one.
Text-level (inline) elements
Despite all the types of information you could add to a document, there are
only a couple dozen text-level semantic elements in HTML5. Table 5-1 lists
all of them.
Table 5-1. Text-level semantic elements
Element Description
a An anchor or hypertext link (see Chapter 6 for details)
abbr Abbreviation
b Added visual attention, such as keywords (bold)
bdi Indicates text that may have directional requirements
bdo Bidirectional override; explicitly indicates text direction (left to right, ltr, or right to left, rtl)
br Line break
cite Citation; a reference to the title of a work, such as a book title
code Computer code sample
data Machine-readable equivalent dates, time, weights, and other measurable values
del Deleted text; indicates an edit made to a document
dfn The defining instance or first occurrence of a term
em Emphasized text
i Alternative voice (italic)
ins Inserted text; indicates an insertion in a document
kbd Keyboard; text entered by a user (for technical documents)
mark Contextually relevant text
q Short, inline quotation
ruby, rt, rp Provides annotations or pronunciation guides under East Asian typography and ideographs
s Incorrect text (strike-through)
samp Sample output from programs
small Small print, such as a copyright or legal notice (displayed in a smaller type size)
span Generic phrase content
strong Content of strong importance
sub Subscript
sup Superscript
time Machine-readable time data
u Underlined
var A variable or program argument (for technical documents)
wbr Word break
Saturday, January 6, 2018
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment