Here is a summary of the most important vocabulary terms that pertain to the structure and appearance of web pages. The following code snippet illustrates each of the terms:
Click or tap on any of the boldface terms below to highlight the corresponding portion of the example:
<h2>
,
<p>
, and <a>
. Some opening
tags, such as <img>
and <br>
, are self-contained
elements that have no content or closing tag.</h2>
,
</p>
, and </a>
. Each closing tag is the same as the corresponding
opening tag, except for an additional slash after the first angle bracket and the omission of any
attributes.id
or src
or style
or onclick
, that is specified
inside its opening tag using the syntax attributename="value". Attribute values should
be enclosed in quotes (though browsers don't always enforce this rule), and multiple
attribute assignments are separated by spaces. The order in which multiple attributes are specified
doesn't matter.<style>
element, but
for simple web pages it is easiest to assign it using the style
attribute.color
or font-family
or
margin
. The syntax for specifying a property is property-name:value;
(note the colon before the value, the semicolon after it, and the absence of quotes). The order in which
multiple properties are specified doesn't matter.So in the code snippet above, there are two CSS properties that are specified in the
style
attribute, which is one of two attributes specified in the opening tag
of the h2
HTML element. Got it? :)