March 02, 2023

Html Introduction

 HTML (Hypertext Markup Language) is the standard markup language used to create web pages. It is used to define the structure and content of a web page, including headings, paragraphs, images, links, and more. HTML code is written using tags, which are enclosed in angle brackets. Let's get started!


Set up your environment

To get started with HTML, you will need a text editor and a web browser. A popular text editor for web development is Visual Studio Code, and a popular web browser is Google Chrome.


Create an HTML file

Open your text editor and create a new file. Save it with the extension ".html". This will tell your computer that it is an HTML file.


Write some HTML code

Now you can start writing your HTML code. Here's a basic example to get started:


<!DOCTYPE html>

<html>

  <head>

    <title>My Web Page</title>

  </head>

  <body>

    <h1>Welcome to my web page!</h1>

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

    <img src="image.jpg" alt="A picture">

    <a href="https://www.google.com/">Visit Google</a>

  </body>

</html>


Let's break down what's happening here:


<!DOCTYPE html> declares that this is an HTML document.

<html> is the opening tag for the HTML document.

<head> contains metadata about the document, such as the title.

<title> sets the title of the document, which appears in the browser tab.

<body> contains the content of the document.

<h1> is a heading tag, which creates a large, bold heading.

<p> is a paragraph tag, which creates a new paragraph.

<img> is an image tag, which displays an image on the page. The src attribute specifies the location of the image file, and the alt attribute provides a description of the image.

<a> is an anchor tag, which creates a hyperlink. The href attribute specifies the destination of the link.

Preview your web page

Save your HTML file and open it in your web browser. You should see your web page displayed in the browser window. Congratulations, you've created your first HTML page!

From here, you can continue to learn and experiment with HTML by adding more tags and styling your page with CSS. Good luck!

No comments:

Post a Comment

HTML Tags

 HTML is made up of tags, which are used to create elements on a web page. A tag consists of an opening tag, content, and a closing tag. The...