Codesuni Logo

HTML Introduction

HTML (HyperText Markup Language) is the standard language used to create webpages. It structures web content using a system of elements enclosed in tags.

HTML Syntax

HTML documents are made of elements, which usually come in pairs: an opening tag and a closing tag.

<!DOCTYPE html>
<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <h1>Hello, World!</h1>
  </body>
</html>

HTML Elements

Common HTML elements include headings, paragraphs, links, and lists. Each has its own specific tag.

<h1> to <h6> for headings
<p> for paragraphs
<a> for links
<ul> and <li> for lists

HTML Attributes

HTML attributes provide additional information about elements. Most elements can have attributes such as id, class, or style.

<a href="https://example.com" target="_blank">Visit Example</a>

TRY IT YOURSELF

Copy the code below and test it in an HTML editor:

<h2>Welcome to HTML!</h2>
<p>This is a paragraph.</p>
<a href="https://www.google.com">Google Link</a>