HTML and CSS Reference
In-Depth Information
Not everything can be marked up semantically as a paragraph or as
emphasized text. Sometimes an element is needed to group other ele-
ments, or to allow other information to be attached to a part of the doc-
ument. For these situations, HTML provides the two elements <div>
and <span> .
A <div> is a block-level element, and a <span> is an inline element. By
themselves, these elements are intentionally semantically neutral; they
don't “mean” anything—or, looked at another way, they can mean
whatever you want them to mean, with the judicious use of id and class
attributes, as in the previous examples. These elements are useful
when you're applying CSS and creating layouts (more about this in
appendix C ).
In this section, you've seen a variety of elements for text: paragraphs,
lists, emphasis, and neutral elements. The web would be a dull place if
this was all web pages were capable of. In the next section, you'll learn
about the elements that make the web interesting: links, images, and
other embedded resources.
Links and embedded resources
Text is all very well, but to make text into hypertext you need to add
links. This section looks at links between documents and links within
documents. It then covers other ways of linking external elements to
HTML documents, both images and more general-purpose objects. To
finish, it looks at <iframe> elements, which give you a way to embed an
entire web page inside another one.
Links and anchors
In HTML content, links that are supposed to be interacted with use the
anchor element, <a> . A link ought to go somewhere, so the target loca-
tion is given in the href (hypertext reference) attribute of the <a> ele-
ment. Three categories of link can be used in the href attribute. The
first is a full URL :
Search WWH ::




Custom Search