What is HTML
What is HTML
HTML Boilerplate
An HTML boilerplate is a basic template for an HTML document that
includes the essential elements needed to create a web page. It
serves as a starting point for web development. Below is a simple
example of an HTML boilerplate:
1. DOCTYPE Declaration:
• The <!DOCTYPE html> declaration defines the document type and version of HTML
being used. It helps the browser render the page correctly.
• Example:
1<!DOCTYPE html>
2. HTML Element:
• The <html> tag is the root element of the HTML document. It wraps all other
elements and can include a lang attribute to specify the language of the document.
• Example:
1<html lang="en">
3. Head Section:
• The <head> section contains meta-information about the document, such as the
title, character set, viewport settings, and links to stylesheets or scripts.
• <title>: Sets the title of the webpage, which appears in the browser tab.
4. Body Section:
• The <body> section contains the actual content of the webpage, including text,
images, links, and other elements that users interact with.
• This is where you will place your headings, paragraphs, lists, images, and other
content.
• While not always included in the boilerplate, a footer can be added to provide
additional information, such as copyright notices or links to privacy policies.
• DOCTYPE Declaration: Ensures the browser knows to render the document as HTML5.
• <html lang="en">: Indicates that the content is in English, which is important for accessibility
and SEO.
• Meta Tags: Provide essential information for browsers and search engines, improving the
page's performance and discoverability.
• Title Tag: Crucial for SEO and user experience, as it appears in search results and browser
tabs.
• Link to CSS: Allows for styling the webpage, separating content from presentation.
• Header, Main, and Footer: These semantic elements help structure the content logically,
improving accessibility and SEO.
• HTML Tags
• HTML tags are the building blocks of HTML. They are used to create
elements and are typically enclosed in angle brackets. Most tags come in
pairs: an opening tag and a closing tag. The opening tag indicates the start of
an element, while the closing tag indicates the end of that element. The
closing tag is similar to the opening tag but includes a forward slash ( /) before
the tag name.
Example----
<p>This is a paragraph.</p>
HTML Elements
HTML elements are the complete set of tags and the content they
contain. An element consists of an opening tag, content, and a
closing tag. Some elements are self-closing and do not require a
closing tag (e.g., <img>).
Example of HTML Elements
1. Paragraph Element
<p>This is a paragraph element.</p>
1. List Element
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
1. Structural Tags
• <html>: Root element of an HTML page.
• <head>: Contains meta-information about the document.
• <title>: Sets the title of the document.
• <body>: Contains the content of the document.
2. Metadata Tags
• <meta>: Provides metadata about the HTML document.
• <link>: Links to external resources (like stylesheets).
• <style>: Contains internal CSS styles.
• <script>: Links to or contains JavaScript.
3. Content Tags
• <h1> to <h6>: Header tags, with <h1> being the highest
level.
• <p>: Paragraph tag.
• <a>: Anchor tag for hyperlinks.
• <img>: Image tag.
• <ul>: Unordered list.
• <ol>: Ordered list.
• <li>: List item.
• <div>: Division or section in a document.
• <span>: Inline container for text.
• <table>: Table element.
• <tr>: Table row.
• <td>: Table data cell.
• <th>: Table header cell.
• <form>: Form for user input.
• <input>: Input field.
• <button>: Button element.
• <label>: Label for an input element.
• <textarea>: Multi-line text input.
• <select>: Dropdown list.
• <option>: Option in a dropdown list.
4. Semantic Tags
Semantic tags are HTML elements that convey meaning
about the content they contain. They help to describe the structure
and purpose of the content, making it easier for both browsers and
developers to understand the layout and function of a webpage.
Semantic tags improve accessibility, search engine optimization
(SEO), and maintainability of the code.
Examples of Semantic Tags
1. <header>: Represents introductory content or a set of
navigational links.