HTML (Hypertext Markup Language) is defined as the standard markup language for creating and structuring web pages. It forms the backbone of the World Wide Web and is essential for creating and rendering web content in web browsers. HTML is not a programming language; rather, it is a markup language used to define the structure and content of web documents.
Here is an introduction to the key concepts and elements in HTML:
1. Elements and Tags:
<
and >
).<h1>
tag is used to create a top-level heading, and the <p>
tag is used for paragraphs.2. Nesting:
<p>
) element inside a <div>
element to group content.3. Attributes:
<img>
tag may include an attribute like src
to specify the image source.4. Structure:
<!DOCTYPE>
) specifying the document type, an <html>
element that wraps the entire page, and two main sections: <head>
for metadata and <body>
for the visible content.5. Head Section:
<head>
section contains metadata, such as the page title, character encoding, and links to external resources like stylesheets and scripts. The title, specified with the <title>
tag, appears in the browser's title bar or tab.6. Body Section:
<body>
section contains the content that is displayed in the browser. This can include text, images, links, forms, and other multimedia elements.7. Links and Anchors:
<a>
(anchor) tag to create hyperlinks, allowing users to navigate to other web pages or resources. Links are defined using the href
attribute.8. Lists:
<ol>
), unordered lists (<ul>
), and definition lists (<dl>
) for structuring content into items.9. Forms:
<form>
element to create interactive forms for user input. You can include text fields, radio buttons, checkboxes, and other form controls.10. Images and Media:
<img>
tag for embedding images and supports multimedia content like audio and video through tags like <audio>
and <video>
.11. Semantic HTML:
<header>
, <nav>
, <article>
, and <footer
, which provide better structure and meaning to web content. These elements help improve accessibility and search engine optimization.12. Validation:
13. CSS and JavaScript:
HTML is the foundation of web development, and learning how to create well-structured, semantic, and valid HTML documents is a fundamental skill for anyone interested in web design and development. It serves as the building block upon which you can create visually appealing and interactive web applications.
Example:-
<Html> <head> <Title> Code2Night </Title> </head> <body> <H1>This is a heading tag</h1> This is Break Tag<br> <b>This is Bold Tag</b> <br> <i>This is Italic Tag</i> <br> <u>This is underline Tag</u> <br> <strong>This is used like bold tag</strong> <br> <s>100</s>90rs(This is strike tag) <br> H<sub>2</sub>O(This is subscript tag) <br> 15<sup>th</sup>aug(This is Superscript Tag) <br> <font size=7 color=red face="jokerman">This is font Tag with attribute i.e Size,Color and Face</font> <hr color=blue size=4 width=100% align=left>This is horizonal rular tag with attribute. <br> </body> </html>
Result:-