Basic Html Codes

4 min read Jul 03, 2024
Basic Html Codes

Basic HTML Codes: A Beginner's Guide

HTML (HyperText Markup Language) is the foundation of every webpage you see on the internet. It's a simple language that tells your browser how to display content on a page. This article will cover the basic HTML codes you need to understand to create a simple webpage.

Essential HTML Structure:

Every HTML document begins with the <html> tag and ends with </html>. Inside these tags, you have two main sections:

  • <head>: Contains information about the document, like the title, meta data, and links to external stylesheets.
  • <body>: Contains the visible content of your webpage, such as text, images, and links.

Here's a basic HTML structure:




  My First Webpage


  

Welcome to my website!

This is a paragraph of text.

Basic HTML Elements:

Headings:

Use headings to structure your content. There are six heading levels: <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>. Larger numbers indicate smaller headings.

Main Heading

Sub Heading

Sub Sub Heading

Paragraphs:

The <p> tag creates a paragraph of text.

This is a paragraph of text. You can add multiple paragraphs to your page.

Text Formatting:

You can format text with the following tags:

  • <b>: Bold text
  • <strong>: Strong text (usually indicates importance)
  • <i>: Italic text
  • <em>: Emphasized text
  • <br>: Line break
  • <hr>: Horizontal rule
This text is bold.
This text is strong.
This text is italic.
This text is emphasized.

This text is on a new line.

Links:

The <a> tag creates a hyperlink to another web page or resource. The href attribute specifies the URL of the link.

Visit Google

Images:

The <img> tag inserts an image into your webpage. The src attribute specifies the image source, and alt provides alternative text for screen readers or if the image cannot be displayed.

A beautiful picture

Conclusion:

This is just a basic introduction to HTML. There are many more elements and attributes that you can use to create complex web pages. To learn more, explore online tutorials, documentation, and practice building your own web pages.

Featured Posts