Family of markup languages for displaying information viewable in a web browser.
HTML, or HyperText Markup Language, is the standard markup language used to create web pages. It is the backbone of any website and is an essential skill for any aspiring web developer. This article will introduce you to the basic syntax and tags used in HTML.
HTML documents are made up of tags. These tags are enclosed in angle brackets, like <tag>
. Most tags come in pairs and surround the content they affect. The opening tag is <tag>
and the closing tag is </tag>
. The content goes between these tags.
For example, to create a paragraph in HTML, you would use the <p>
tag:
<p>This is a paragraph.</p>
There are many HTML tags, each serving a different purpose. Here are a few commonly used ones:
<h1>
to <h6>
: These tags are used for headings, with <h1>
being the largest and <h6>
being the smallest.<a>
: This is the anchor tag, used to create hyperlinks.<img>
: This tag is used to embed images.<div>
: This is a container tag that is used to group other elements.Now that you know some basic tags, let's create a simple HTML page. Here's an example:
<!DOCTYPE html> <html> <head> <title>My First Web Page</title> </head> <body> <h1>Welcome to My Web Page</h1> <p>This is a paragraph.</p> <a href="https://www.example.com">This is a link.</a> </body> </html>
In this example, <html>
is the root element. The <head>
element contains meta-information about the document, and the <title>
tag specifies the title of the web page. The <body>
tag contains the content of the web page.
By understanding the basic syntax and tags of HTML, you've taken your first step into the world of web development. Practice using these tags until you're comfortable with them, and you'll be well on your way to creating your own web pages.