Html 5 Basic Tags Example

Html 5 Basic Tags Example

·

4 min read


Introduction

In this chapter, we are going to look at some of examples in html. We are going to go through all the tags that will be used one by one so that you can follow them.

AD-BANNER

HTML BASIC EXAMPLE

HTML DOCUMENT

All Html documents must always start with a document type declaration <!DOCTYPE html>. The HTML document itself must begin with <html> and end with the </html> closing tags. This is to indicate that it is an HTML document. The visible part of the HTML document is between <body> and </body>.

HTML CODE:

<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <h1>My First Heading</h1>
    <p>My first paragraph.</p>
  </body>
</html>

The <!DOCTYPE> Declaration The <!DOCTYPE> declaration stands for the document type and helps browsers display web pages correctly. Its features include that it must always appear once at the top of the page (before HTML tags). It is not case-sensitive and is written as <!DOCTYPE html> in HTML5.

HTML Headings

The HTML heading is defined from <h1> till <h6>The <h1> is usually the biggest heading and is the most important heading. The <h6> is usually the smallest heading and is the least important heading.

HTML CODE:

<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
<h4>This is a heading</h4>
<h5>This is a heading</h5>
<h6>This is a heading</h6>

How it will appear:

This is a heading

This is a heading

This is a heading

This is a heading

This is a heading
This is a heading

HTML Paragraphs

HTML paragraphs are defined with <p> tag

HTML CODE:

<p>This is a paragraph</p>
<p>This is another paragraph</p>

How it will appear:

This is a paragraph

This is another paragraph

HTML LINK

The HTML link is usually defined with <a> tag:

HTML CODE:

<a href="https://www.google.com">
  This is a link
</a>

How it will appear:

This is a link

The link destination is specified in the href attribute. Attributes will be looked at in a later lesson. It provides additional information about that HTML element.

HTML Images

HTML images are defined with the <img> tag. The attribute has the source file(src), alternative text (alt), width, and height.

HTML CODE:

<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1623431953516/5Dsy8JUPD.xml" 
alt="example image" width="164" height="144" />

How it will appear:

example image

How to view HTML source

If you have a web page. You will probably wonder how they do that. At the web page right-click and select “View Page Source” (in Chrome). This will open a window containing the HTML source code of the page. Inspect an HTML Element Right-click on the element (or a blank area), and choose “inspect” or “inspect Element” to see what elements are made up of (you will see both the HTML and CSS) don’t worry we are going to learn of CSS in another lesson. You will be able to edit the codes (HTML and CSS).

HTML Tables

The <table> tag defines an HTML table. Each table row is defined with <tr> tag. Each table header is defined with <th> tag. Each table data/cell is defined with a <td> tag. These tags have a default which includes having the text in <th> element in bold and centered. Equally, the text in <td> element is regular and left-aligned.

HTML CODE:

<table style = width: 100%”>
<tr>
      <th>firstName</th>
        <th>LastName</th>
          <th>age</th>
</tr>
<tr>
       <td>tommay</td>
         <td>Okon</td>
           <td>24</td>
</tr>
<tr>
         <td>Jenny</td>
         <td>kwon</td>
           <td>22</td>
</tr>
</table>

How it will appear:

firstNameLastNameage
tommayOkon24
Jennykwon22

HTML List

The HTML list is usually donated with the <ul> (unordered/bullet list) or the <ol> (ordered/numbered list) tag, followed by the <li> tags (list items)

HTML CODE:

<ul>
  <li>mango</li>
  <li>orange</li>
  <li>apple</li>
</ul>

How it will appear:

  • mango

  • orange

  • apple

HTML Button

The HTML button is defined with the <button> tag

HTML CODE:

<button>Click me</button>

How it will appear:

Click me

Create Stunning Websites and Web Apps

Building different custom components in React for your web apps or websites can get very stressful. That's why we decided to build contrast. We have put together a UI kit with over 10000+ components, 5 admin dashboards and 23 additional different pages template for building almost any type of web app or webpage into a single product called Contrast Pro. Try contrast pro!

Contrast Design Boostrap

Contrast React Bootstrap PRO is a Multipurpose pro template, UI kit to build your next landing, admin, SAAS, a prelaunch, etc project with a clean, well-documented, well-crafted template and UI components. Learn more about Contrast Pro

RESOURCES

Introduction to CSS Animation

CSS Colors, Backgrounds, Borders, Margins and Padding

CSS Combinators

CSS Flexbox

CSS Fonts

CSS Grid

CSS Height And Width

Tutorial: CSS Icons

Tutorial: CSS Pagination

CSS Syntax and Selector

CSS Text and Layout

Full Website Layout

Introduction to CSS

Differences Between Tailwind CSS and Bootstrap

Differences between Tailwind CSS and SASS

All you need to know about Html Elements

HTML File path, Charset and Meta

Html 5 Formating

Html 5 Layout

Html 5 Basic Tags Example

Html Editors

HTML Quotations and comments

Including JavaScript in your HTML project.

HTML Forms

Creating Responsive HTML web design

HTML Tables, Classes and Ids

Introducing HTML