Introduction to Basics of HTML by Santhosh kumar Ataluri

Jul 8, 2023 - 22:38

Certainly! Here are some of the key basics of HTML:

  1. HTML Tags: HTML is based on a set of tags that define the structure and content of a web page. Tags are enclosed in angle brackets (< and >). For example, <p> represents a paragraph tag, <h1> represents a heading tag, and so on.

  2. Elements and Nesting: HTML tags, when used with their opening and closing tags, create HTML elements. Elements can be nested inside each other, forming a hierarchical structure. For example:

    <div> <h1>Hello, world!</h1> <p>This is a paragraph.</p> </div>

    In this example, the <div> element contains an <h1> element and a <p> element.

  3. Attributes: HTML tags can have attributes that provide additional information about the element. Attributes appear within the opening tag and consist of a name and a value, separated by an equals sign (=). For example:

    <a href="">Visit Example</a>

    In this example, href is an attribute of the <a> (anchor) tag,  and its value is the URL the link points to.

  4. Document Structure: An HTML document typically consists of the following structure:

    <!DOCTYPE html> <html> <head> <!-- Meta tags, title, linked stylesheets, etc. --> </head> <body> <!-- Content of the web page --> </body> </html>
    • <!DOCTYPE html>: The doctype declaration, which defines the document type as HTML5.
    • <html>: The root element that wraps the entire HTML document.
    • <head>: Contains meta-information about the document and external resources.
    • <body>: Contains the visible content of the web page.
  5. Headings: HTML provides six levels of headings, <h1> to <h6>, with <h1> being the highest level and <h6> the lowest. Headings are used to define the structure and hierarchy of the content.

  6. Paragraphs: The <p> tag is used to define paragraphs of text. It represents a block of text.

  7. Links: Links are created using the <a> (anchor) tag. The href attribute specifies the URL the link points to.

  8. Images: Images are displayed using the <img> tag. The src the attribute specifies the path to the image file, and the alt attribute provides alternative text for the image.

  9. Lists: HTML offers ordered lists (<ol>), unordered lists (<ul>), and definition lists (<dl>) to present content in a list format.

  10. Tables: Tables are created using the <table> tag, with additional tags like <tr> (table row), <th> (table header), and <td> (table data) to structure the table.

These are just a few fundamental concepts of HTML. As you progress, you'll explore more elements, attributes, and advanced features. Remember to refer to official documentation or reliable HTML resources for comprehensive information and examples.

What's Your Reaction?