HTML

(Hypertext markup language)

HTML TUTORIAL

  • Html Introduction
  • Html Editor
  • Html Basic
  • HTML Element
  • HTml Attributes
  • Html Heading
  • HTMl Paraagraph
  • HTML Links
  • HTML Formating
  • HTML image
  • HTML Favicon
  • HTML Page title
  • HTML Tables
  • HTML list
  • HTML Block & inline
  • HTML Iframe
  • HTML Form
  • Html ID & class

HTML INTRODUCTION

HTML, or Hypertext Markup Language, is the standard markup language for creating web pages and web applications. It provides the structure and content of a webpage, using tags to define different elements such as headings, paragraphs, images, links, and more. HTML documents are interpreted by web browsers to display content on the internet. HTML, developed by Tim Berners-Lee in the early 1990s, forms the backbone of the World Wide Web. It's a markup language comprising elements represented by tags enclosed in angle brackets, conveying the meaning and structure of content. HTML5, the latest version, introduces new features for multimedia, semantic markup, and enhanced accessibility, shaping modern web development.


HTML EDITOR

An HTML editor is a software tool used for writing and editing HTML code. It provides a user-friendly interface with features like syntax highlighting, code autocompletion, and preview options, making it easier for developers to create and manage web pages. Advanced HTML editors often include additional functionalities such as integrated debugging tools, FTP support for uploading files to web servers, and compatibility with other web technologies like CSS and JavaScript. These editors play a vital role in streamlining the web development process, empowering developers to create professional-looking websites efficiently.

HtML BASIC

HTML, or Hypertext Markup Language, serves as the foundation of web development. It consists of a series of elements, each enclosed in angle brackets, which define the structure and content of a webpage. Basic HTML includes tags for headings, paragraphs, links, images, and lists. Understanding HTML basics is essential for anyone venturing into web development, as it provides the building blocks for creating functional and visually appealing websites.

HTML ELEMENT

HTML (Hypertext Markup Language) elements are the building blocks of web pages. They are represented by tags enclosed in angle brackets. Each HTML element serves a specific purpose and contributes to the structure and content of a webpage. Here are some common HTML elements:

  • <html>: Defines the root of an HTML document.
  • <head>: Contains metadata about the document.
  • <title>: Sets the title of the document.
  • <body>: Encloses the main content of the document.
  • <h1> to <h6>: Define headings of decreasing importance.
  • <p>: Represents a paragraph of text.
  • <a>: Creates hyperlinks to other web pages or resources.
  • <img>: Embeds images into the document.
  • <ul>: Defines an unordered list.
  • <li>: Represents a list item within an ordered or unordered list.

HTML ATTRIBUTES

HTML attributes provide additional information about HTML elements and are added to the opening tag of an element. They help define the behavior, appearance, or functionality of the element. Here's a paragraph describing HTML attributes: HTML attributes are key-value pairs added to HTML elements to modify their behavior or appearance. Common attributes include "class" for styling, "id" for identification, "href" for hyperlinks, and "src" for image sources. Attributes enhance the functionality and accessibility of HTML elements, facilitating interactive and visually appealing web pages.

  • <a href="#">: Specifies the URL of the linked page.
  • <abbr title="abbreviation">: Specifies an abbreviated version of the content.
  • <alt="alternative text">: Specifies alternative text for an image.
  • <class="class-name">: Specifies one or more class names for an element.
  • <id="element-id">: Specifies a unique id for an element.
  • <src="image.jpg">: Specifies the URL of the image.
  • <style="CSS styles">: Specifies inline CSS styles for an element.
  • <title="tooltip text">: Specifies extra information about an element.

HTML HEADING

HTML headings are titles or subtitles that you want to display on a webpage.

  • <h1> - Main Heading
  • <h2> - Subheading
  • <h3> - Sub-subheading
  • <h4> - Sub-sub-subheading
  • <h5> - Sub-sub-sub-subheading
  • <h6> - Sub-sub-sub-sub-subheading

HTML PARAGRAGH

A paragraph always starts on a new line, and is usually a block of text.

  • <p> </p> - in between you can write

HTML FORMATTING

HTML formatting refers to the way in which the content of a web page is visually presented to the user. It involves using HTML elements and attributes to control the appearance of text, images, and other elements on the page. HTML provides a variety of formatting options to customize the layout, style, and structure of the content. Some common HTML formatting techniques include:

  • Text Formatting: HTML provides tags like <b>, <i>, <u>, <strong>, <em>, and <s> for applying bold, italic, underline, strong emphasis, emphasis, and strikethrough styles to text, respectively.
  • Headings and Paragraphs: Headings are structured text elements ranging from <h1> to <h6> that define the hierarchy of the content. <p> tags are used for paragraphs.
  • Lists: HTML supports ordered lists (<ol>) and unordered lists (<ul>) with list items (<li>) for organizing content in a structured format.
  • Links: As discussed earlier, HTML <a> tags are used to create hyperlinks, allowing users to navigate between different web pages or resources.
  • Images: Images can be displayed using the <img> tag, and attributes like src, alt, width, and height can be used to control their appearance and behavior.
  • Tables: HTML tables (<table>) are used for displaying tabular data, and various attributes such as border, cellpadding, cellspacing, and CSS styles can be applied for formatting.
  • Forms: HTML provides form elements (<form>, <input>, <textarea>, <select>, etc.) for collecting user input, and attributes like type, placeholder, required, and CSS styles can be used for formatting and validation.
  • CSS: While HTML provides basic formatting capabilities, Cascading Style Sheets (CSS) are commonly used to enhance the visual presentation of web pages further. CSS allows for precise control over colors, fonts, margins, padding, positioning, and other stylistic aspects of HTML elements.

HTML IMAGES

HTML images are elements used to display graphics or images on a web page. The primary HTML tag for displaying images is the <img> tag. Here's a basic example of how to use the <img> tag to display an image:

  • <img> is the image tag.
  • src attribute specifies the URL or path to the image file. It's mandatory and indicates the source of the image.
  • alt attribute provides alternative text for the image, which is displayed if the image cannot be loaded or by screen readers for accessibility purposes.
  • Example <img src="image.jpg" alt="Description of the image" width="300" height="200">

Images can improve the design and the appearance of a web page.

HTML FAVICON

HTL Favicon likely refers to a Favicon associated with the HTL (Hotel) brand or website. A favicon is a small icon displayed in web browsers next to the URL of a website. It serves as a visual identifier for the website. HTL Favicon would be specific to the HTL brand or website, possibly featuring their logo or another recognizable symbol associated with them. syntax of html favicon

  • <link rel="icon" href="favicon.ico" type="image/x-icon" />
  • <link rel="icon" href="favicon.ico" type="image/png" sizes="16x16" />
  • <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
  • Use <link> element to define the relationship.
  • Specify the path to your favicon image with the href attribute.
  • Define the MIME type of the favicon image using the type attribute, commonly image/x-icon.
  • For modern browsers supporting PNG favicons:
    • Use type="image/png" with sizes="16x16" for an alternative PNG version sized 16x16 pixels.
  • For compatibility with older versions of Internet Explorer:
    • Add a second <link> element with rel="shortcut icon" attribute.

HTML PAGE TITLE

The HTML title element, <title>, is used to define the title of a document. It's placed within the <head> section of an HTML document and typically appears in the browser's title bar or tab. The text inside the <title> element is what appears as the title of the web page in the browser window. <title>The HTML title element, <title>, is used to define the title of a document. It's placed within the <head> section of an HTML document and typically appears in the browser's title bar or tab. The text inside the <title> element is what appears as the title of the web page in the browser window.</title>

  • <title>Your Title Here</title>

HTML TABLES

HTML tables are used to display data in rows and columns on a web page. They consist of the < table> element, which contains one or more < tr> (table row) elements, each of which contains one or more < td> (table data/cell) elements for regular cells, or < th> (table header) elements for header cells. Here's a basic example of an HTML table structure:

  • <table>: Defines the start of the table.
  • <tr>: Defines a table row.
  • <th>: Defines a header cell. It's typically bold and centered by default.
  • <td>: Defines a standard cell containing data.

HTML LIST

HTML lists are used to organize and present information in a structured manner. There are three types of lists in HTML:

  • <ol>: An ordered list is a list where each item is numbered. It's created using the <ol> element, and each item is represented by the <li> (list item) element. By default, items are numbered sequentially.
  • <ul>: An unordered list is a list where each item is marked with a bullet point. It's created using the <ul> element, and each item is represented by the <li> element.
  • <dl>: A description list is a list of terms and their corresponding descriptions. It's created using the <dl> element. Each term is represented by a <dt> (description term) element, and each description is represented by a <dd> (description details) element.

HTML BLOCK & INLINE ELEMEMT

HTML elements can be classified into two main categories: block-level elements and inline elements.

A block-level element in HTML is an element that typically starts on a new line and occupies the full width available to it, extending the entire width of its containing element by default. These elements create structural blocks or sections of content within a web page layout.

  • <div>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.
  • <p>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.
  • <h1> to <h6>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.
  • <ul>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.
  • <ol>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.
  • <li>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.
  • <table>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.
  • <form>: These elements typically start on a new line and occupy the full width available to them, extending the entire width of their container by default.

An inline element in HTML is an element that does not start on a new line and only occupies the space necessary for its content, without forcing a new line to begin after it. These elements are often used to style individual pieces of text or elements within a block-level element.

  • <span>: Represents a generic inline container for styling purposes or grouping inline elements.
  • <a>: Represents a hyperlink.
  • <strong>: Represents strong importance, typically displayed as bold text.
  • <em>: Represents emphasized text, typically displayed in italics.
  • <img>: Represents an image.
  • <input>: Represents an input field, such as a text input or checkbox.
  • <abbr>: Represents an abbreviation or acronym, typically with a dotted underline for styling.
  • <cite>: Represents the title of a work, typically italicized.
  • <code>: Represents a fragment of computer code, typically displayed in a monospace font.
  • <data>: Represents the value of a machine-readable attribute.
  • <dfn>: Represents the defining instance of a term, typically italicized.
  • <i>: Represents a span of text in an alternate voice or mood, typically displayed in italics.
  • <kbd>: Represents user input, typically displayed in a monospace font.
  • <label>: Represents a label for an input element.
  • <q>: Represents a short inline quotation, typically enclosed in quotation marks.
  • <s>: Represents text that is no longer accurate or relevant, typically displayed with a strikethrough.
  • <small>: Represents small print text, typically displayed smaller than the surrounding text.
  • <sub>: Represents subscript text, typically displayed below the baseline.
  • <sup>: Represents superscript text, typically displayed above the baseline.
  • <time>: Represents a specific period in time or a date.
  • <u>: Represents text that should be stylistically rendered with an underline.
  • <var>: Represents a variable, typically displayed in italics.

HTML IFRAME

An HTML iframe (inline frame) is an HTML element used to embed another HTML document within the current HTML document. It allows you to display content from another web page, video, or any other resource from a different source within the context of the current page. The content displayed inside an iframe is independent of the surrounding content of the parent document and operates within its own browsing context.

  • <iframe> (inline frame) is an HTML element used to embed another HTML document within the current HTML document. It allows you to display content from another web page, video, or any other resource from a different source within the context of the current page.
  • Embedding Content: iframes enable you to embed content from external sources, such as other websites, into your own web page.
  • Separate Document Context: The content displayed within an iframe operates independently from the rest of the page, maintaining its own browsing context. This means that JavaScript, CSS, and other resources within the iframe do not affect the parent document and vice versa.
  • Customizable Size: You can specify the dimensions (width and height) of the iframe to control the size of the embedded content within the parent document.
  • Cross-Origin Resource Sharing (CORS): If the content being loaded into the iframe is from a different domain, the Same-Origin Policy may restrict access to certain resources. CORS headers may need to be properly configured on the server to allow the iframe to access content from other domains.
  • Fallback Content: You can provide fallback content within the iframe element, which will be displayed if the browser does not support iframes or if the content cannot be loaded for some reason.
  • Security Considerations: When embedding content from external sources, it's important to consider security implications, such as the risk of cross-site scripting (XSS) attacks or clickjacking.
  • <iframe src="https://www.example.com" width="600" height="400" frameborder="0" scrolling="no"></iframe>

HTML FORM

An HTML form is a fundamental element used to collect user input on a web page. It allows users to enter data, which can then be submitted to a server for processing. Forms are essential for various interactive features on websites, such as login pages, registration forms, search fields, and contact forms.

  • Form Element (<form>): The <form> element serves as the container for all the input fields and controls within the form. It defines where the form data will be sent when submitted.
  • Form Controls: Form controls are the elements within the form that allow users to input data. Common form controls include text inputs (<input type="text">), password inputs (<input type="password">), checkboxes (<input type="checkbox">), radio buttons (<input type="radio">), select dropdown menus (<select>), textareas (<textarea>), and buttons (<button> or <input type="submit">).
  • Form Submission: When a user fills out the form and submits it, the data entered into the form fields is sent to the server specified in the <form> element's action attribute. By default, the form data is sent via an HTTP POST request, but this can be changed to a GET request by setting the method attribute of the <form> element to "get".
  • Input Validation: HTML forms can include client-side validation using attributes like required, pattern, and maxlength to enforce input rules and constraints before the form is submitted. Additionally, server-side validation should also be implemented to ensure data integrity and security.
  • Form Controls Grouping: Form controls can be grouped using the <fieldset> element, which helps to organize related inputs and provides a visual grouping via the <legend> element.

FORM ATTRIBUTES

HTML form elements support various attributes that help define their behavior and appearance. Here are some commonly used HTML attributes for forms:

  • action: Specifies the URL where the form data will be submitted when the form is submitted.
  • method: Defines the HTTP method used to submit the form data. It can be "get" or "post". The default method is "get".
  • target: Specifies where to display the response after submitting the form. It can be "_self" (default), "_blank", "_parent", or "_top".
  • enctype: Specifies how form data should be encoded before sending it to the server. Common values include "application/x-www-form-urlencoded" (default), "multipart/form-data", and "text/plain".
  • autocomplete: Indicates whether the browser should automatically complete form fields based on previous input. Values can be "on" or "off".
  • novalidate: Prevents browser validation of form elements. Useful for custom client-side validation.
  • name: Specifies the name of the form. Useful for targeting forms with JavaScript or CSS.
  • id: Specifies a unique identifier for the form. Useful for targeting forms with JavaScript or CSS.
  • class: Specifies one or more classes for the form. Useful for styling forms with CSS.
  • onsubmit: Specifies a JavaScript function to execute when the form is submitted.
  • onreset: Specifies a JavaScript function to execute when the form is reset.
  • accept-charset: Specifies the character encodings that are accepted by the server when processing the form data.

FORM INPUT

HTML form inputs are elements within a form that allow users to input data. These inputs enable users to provide information, make selections, and interact with the web page. Here are some commonly used HTML form input elements:

  • Text Input (<input type="text">): Allows users to enter a single line of text.
  • Password Input (<input type="password">): Similar to a text input but hides the characters typed by the user, typically used for sensitive information like passwords.
  • Checkbox (<input type="checkbox">): Allows users to select one or more options from a list of choices.
  • Radio Button (<input type="radio">): Allows users to select one option from a list of choices.
  • Select Dropdown Menu (<select>): Presents users with a dropdown list of options from which they can select one.
  • Textarea (<textarea>): Allows users to enter multiple lines of text, suitable for longer messages or comments.
  • File Input (<input type="file">): Allows users to upload files from their device.
  • Submit Button (<input type="submit"> or <button type="submit">): Submits the form data to the server for processing.
  • Reset Button (<input type="reset"> or <button type="reset">): Resets all form fields to their default values.
  • Hidden Input (<input type="hidden">): Stores data that is not displayed to the user but is submitted with the form.

HTML ID & CLASS

  • Class: In HTML, the class attribute is used to specify one or more classes for an HTML element. A class is essentially a way to apply a set of CSS styles to one or more HTML elements. By assigning a class to an element, you can target it with CSS and apply styles defined in the associated CSS rule. Classes are reusable, meaning you can apply the same class to multiple elements throughout your HTML document or across multiple documents. Multiple classes can be applied to a single element by separating them with spaces.
  • ID: The id attribute in HTML is used to specify a unique identifier for an HTML element. Unlike classes, IDs are intended to be unique within a document, meaning each element should have a unique id value. The id attribute is often used to target specific elements with CSS or JavaScript for styling or scripting purposes. While IDs are unique within a document, they can still be used alongside classes to apply additional styling or behavior.
  • Class Selector: The class selector in CSS is used to target elements based on their class attribute. It begins with a period (.) followed by the name of the class.
    Example:
    <style>
                                      .highlight {
                                        background-color: yellow;
                                      }
                                      </style>
                                  
                                      <p class="highlight">This paragraph has a class of "highlight".</p>
                                      
  • ID Selector: The ID selector in CSS is used to target elements based on their id attribute. It begins with a hash (#) followed by the id value.
    Example:
    <style>
                                      #header {
                                        font-size: 24px;
                                        font-weight: bold;
                                      }
                                      </style>
                                  
                                      <div id="header">This is the header</div>