/* */ HTML Basic Codes

HTML Basic Codes

Kaveesha Chathil
2

HTML

Welcome to your first lesson on basic HTML codes! HTML stands for HyperText Markup Language and it is the code used to create web pages. In this lesson, we will cover the basic HTML tags that you need to know to create a simple web page.

HTML tags are enclosed in angle brackets (<>) and consist of a tag name and attributes. The tag name indicates what type of element it is and the attributes provide additional information about the element. Let's dive in and learn some basic HTML codes!


  • HTML Document Structure

 To start creating an HTML document, you need to declare the document type using the following code:

<!DOCTYPE html>

This tells the browser that this is an HTML document.

The next tag you need is the <html> tag. This tag wraps around all the content on the page and tells the browser that everything inside is HTML code.

<html>

  <!-- your HTML code goes here -->

</html>

  • Head and Body Tags

The <head> and <body> tags are used to define the content of the web page. The <head> tag contains information about the document such as the title, keywords, and description. The <body> tag contains the visible content of the web page.

<!DOCTYPE html>

<html>

  <head>

    <title>My First Web Page</title>

  </head>

  <body>

    <!-- your visible content goes here -->

  </body>

</html>

  • Heading Tags

The <h1> to <h6> tags are used to define headings on the web page. The <h1> tag is the largest heading and the <h6> tag is the smallest heading.

<h1>This is the main heading</h1>

<h2>This is a subheading</h2>

  • Paragraph Tags

The <p> tag is used to define paragraphs on the web page.

<p>This is a paragraph of text.</p>

  • Link Tags

The <a> tag is used to create links on the web page. The href attribute specifies the URL of the page to link to.

<a href="https://www.example.com">Link to Example Website</a>


  • Image Tags

The <img> tag is used to display images on the web page. The src attribute specifies the location of the image file.

<img src="image.jpg" alt="Description of image">

  • List Tags

The <ul> and <ol> tags are used to create unordered and ordered lists, respectively. The <li> tag is used to define each item in the list.

<ul>

  <li>Item 1</li>

  <li>Item 2</li>

</ul>

<ol>

  <li>Item 1</li>

  <li>Item 2</li>

</ol>

Congratulations! You've learned some basic HTML codes. With these tags, you can start creating your own simple web page. Remember to always test your code in a web browser to see how it looks. Happy coding!

Post a Comment

2 Comments

Please Select Embedded Mode To show the Comment System.*