HTML (HyperText Markup Language)
is the standard language used to create and design web pages.
It structures the content on the web
, using a series of elements or tags that tell the browser how to display text, images, links, and other multimedia
.
Points About HTML
- Basic Structure: An HTML document starts with a
<!DOCTYPE html>
declaration, followed by<html>
,<head>, and <body> tags
. - Tags and Elements: HTML uses tags like
<p>, <h1>, <a>
, and<img>
to define different elements on the page. - Attributes: Tags can have attributes that
provide additional information
, such as href in<a>
for links and src in<img>
for images. - Nesting: HTML elements can be
nested inside each other
to create complex structures. - Semantic HTML: Use of meaningful tags like
<header>, <footer>, <article>,
and<section>
to improve accessibility and SEO.
Simple Examples of HTML
Basic HTML Document
<!DOCTYPE html> <html> <head> <title>My First Web Page</title> </head> <body> <h1>Welcome to My Website</h1> <p>This is a paragraph introducing my website.</p> </body> </html>
Here-
<!DOCTYPE html>
declares the document type<html>
is the root element.<head>
contains meta-information like the title.<body>
contains the content displayed on the page, including a heading<h1>
and a paragraph<p>
.
Adding a Link
<!DOCTYPE html> <html> <head> <title>Link Example</title> </head> <body> <h1>Visit My Favorite Website</h1> <p>Click <a href="https://www.djangoproject.in/">here</a> to visit my favorite website.</p> </body> </html>
Here -
- The
<a>
tag creates a hyperlink. Thehref
attribute specifies the URL to link to.
Using Lists
<!DOCTYPE html> <html> <head> <title>List Example</title> </head> <body> <h1>My Favorite Fruits</h1> <ul> <li>Apple</li> <li>Banana</li> <li>Cherry</li> </ul> </body> </html>
Here -
- The
<ul>
tag creates an unordered list. - The
<li>
tags create list items.
HTML is essential for web development, forming the backbone of web content.
By mastering HTML, you can create well-structured, accessible, and SEO-friendly web pages.