coding180 icon
Coding180
HTML Tag - Syntax

HTML Tag - Syntax

Home > Tutorials > HTML > HTML Introduction


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

  1. <p></p> - paragraph 
  2. <div></div> - Div Tag.
  3. <span></span> - span tag
  4. <img> - image tag
  5. <a> - Anchor tag
  6. <li> - List Tag
  7. 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>

 


user

Robort Gabriel

Lagos, Nigeria

Freelance Web Developer, Native Android Developer, and Coding Tutor.

Skills
  • UI / UX
  • JavaScript
  • Python
  • PHP
  • Kotlin
  • Java
  • Bootrap
  • Android
  • Laravel