Syntax
HTML documents define elements of a web page by using tags with element names. Tags are always surrounded by angle brackets, such as the <body> tag. Each element defines the end of a tag set by using a forward slash before the tag name, such as </body>. The contents of the element lie between a set of opening and closing tags. For example, everything between the <body>, and matching </body> tag, defines the content of the body element.
Some tags also have extra properties defined in key-value pairs called attributes. These are used to describe extra information about the element. In the example shown, there is an <a> tag that has an attribute called href, whose value is https://www.iana.org/domains/example. In this case, the href
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