HTML Introduction

Introduction to HTML

What is HTML?

HTML Stands for HyperText Markup Language.It is not a programing language, but a Markup Language used to create and structure content on the web. HTML describe the structure of a web page .


  • HyperText:it is a text that contains links to other texts
  • Markup: symbols or codes injected in a document to outline structure and arrangement
  • Language: Form of communicative interaction with grammatical principles

Basic HTML Document Structure

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

Basic HTML Tags

Tag Meaning / Description
<!DOCTYPE html> Document type
<html> Root element of an HTML page
<head> Meta information
<title> title tag specifies a title for the webpage
<body> The visibel content in the webpage
<h1> Big heading
<p> Paragraph

Text Elements

Tag Meaning / Description
<h1> to <h6> Headings(from largest to smallest)
<p> Paragraph
<br> Line break
<hr> Horizontal line

Formatting

Tag Meaning / Description
<b> or <strong> Bold text
<i> or <em> Italic text
<u> Underline text
<mark> Highlighted text

Link and Images

Tag Meaning / Description
<a href="url"> link text </a> create a hyperlink
<img src="image.jpg" alt="description"> Embeds an image

Lists

Tag Meaning / Description
<ul> Unordered(bulleted) list
<ol> Ordered(numbered)list
<li> List item

HTML Attributes

Attributes provide additional information about HTML elements.

  1. They always specified in the start tag.
  2. They usually come in name or value pair like:name="value"
  3. Example<a href="https://www.example.com">Visit Example</a>

    Common Attributes:
  1. id: id Specifies Unique identifier for an element.
  2. class: Specifies one or more class names
  3. style: Specifies inline CSS
  4. src: Specifies the source of embedded content
  5. href: They specifies URL for links

    Create your first html webpage
  1. Open any text editor for example(Notepad, VS Code etc)
  2. Write your first html code in editor
  3. Then save the file for example index.html
  4. Then run the code and open in web browser

HTML Online Editor

<h1>Hello World</h1> <p>This is a paragraph.</p>
body { background-color: #f0f0f0; } h1 { color: red; }
document.querySelector('h1').onclick = () => { alert("Heading clicked!"); };


Uses of HTML

Web Page Creation

With HTML, you can design and create the structure of a website.

Inserting Media

Images, audio, and videos can be placed on webpages.

Hyperlinking

HTML also enables you to link different web pages.

Creating Forms

Login, contact and other forms are created using HTML.

Template Design

It is useful for crafting templates for emails and web applications.

Embedding Content

You can also embed Google Maps and Youtube videos in your website.


Advantages of HTML

  • Easy to Learn and Use
  • Beginners can effortlessly master it.
  • Works on every browser and OS
  • Compatible with every web browser and operating system.
  • No financial burdens
  • HTML had no fees, costs or licenses associated with it.
  • Universal Browser Support
  • Chrome, Firefox and Safari among others can run HTML pages.
  • Enhances SEO
  • HTML in web pages assists in search engine optimization.
  • Combines with CSS and JavaScript
  • Cross-compatible with other design and interactive technologies.

    Disadvantages of HTML

  • Stagnant Features
  • HTML web pages don’t possess logic, calculations or any dynamic features.
  • Limited Styling
  • CSS is required for an attractive web design.
  • Lacks Security Features
  • Without back-end support or JavaScript, HTML cannot protect information.
  • Excessive Coding for Minor Efforts
  • Even basic actions can demand an excess of programming logic.
  • Broad strokes encompass decision making or computational analysis
أحدث أقدم