HTML Tags are labels (names) you used to mark up the start and end of an element.
It begins with a less-than sign <
followed by the tag name and end with a greater-than sign >
.
Element is made up of an opening tag, contents and a closing tag.
- Opening tag,
- Opening tag marks the opening of an element, this is where you set the attributes.
- Tag Content
- This is where you put the contents of the element.
- Closing tag.
- This marks the end of an element.
Common HTML Elements
<p></p>
- paragraph<div></div>
- Div Tag.<span></span> -
span tag- <img> - image tag
- <a> - Anchor tag
- <li> - List Tag
- etc...
Tags and tags can be nested, but the sequence must be consistent, such as: <p> is nested in <div>, then </p> must be placed in front of </div>. As shown below.
<div><p> This paragraph is nested inside div tag </p></div>
HTML tags are not case-sensitive, <h1>
and <H1>
are the same, but lowercase is recommended, because most programmers use lowercase as the standard.
Task - Exercise
Complete the missing code on line 9.
Task Code:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
Syntax of the <title> tag</title>
</head>
<body>
<h1>In this tutorial, you will learn how to use HTML
to create a site</h1>
<p>Inline styles are used when specific styles need
to be applied to individual elements. </p>
</body>
</html>
//= htmlentities($post["body"]); ?>