Savills Vietnam

Savills Vietnam

Did You Know?

Ask us anything here

HTML – Basic Knowledge

Estimated reading: 4 minutes 29 views

HTML stands for Hypertext Markup Language. It’s the standard markup language used to create web pages. HTML describes the structure of a web page semantically and consists of a series of elements, which can be nested inside each other to define the content and layout of the page.

Tags

HTML elements are represented by tags, enclosed in angle brackets, such as <html>, <head>, <title>, <body>, <div>, <p>, <img>, <a>, and many others. These tags define the different parts of a webpage, which includes 6 main group of tag:

1. Structural Tags:

  • <html>: Defines the root of an HTML document.
  • <head>: Contains meta-information about the document like title, links to stylesheets, etc.
  • <title>: Sets the title of the document, which appears in the browser’s title bar or tab.
  • <body>: Contains the content of the document that is displayed in the browser window.

2. Content Display Tags:

  • <div>: Defines a division or section of the document.
  • <span>: Marks a section of text with no semantic meaning.
  • <p>: Defines a paragraph of text.

3. Sectioning Tags:

  • <header>: Contains introductory content, usually the title and navigation menu.
  • <nav>: Defines a section of navigation links.
  • <section>: Groups related content together.
  • <article>: Defines an independent piece of content like a blog post or news article.
  • <aside>: Contains content tangentially related to the content around it.
  • <footer>: Contains footer information like copyright, contact details.

4. Media Display Tags:

  • <img>: Embeds an image into the document.
  • <audio>: Embeds audio content into the document.
  • <video>: Embeds video content into the document.
  • <iframe>: Embeds another HTML document within the current one.

5. Data Definition Tags:

  • <ul>: Defines an unordered list.
  • <ol>: Defines an ordered list.
  • <li>: Defines a list item.
  • <table>: Defines a table.
  • <tr>: Defines a row within a table.
  • <td>: Defines a cell within a table.

6. Form Definition Tags:

  • <form>: Defines an HTML form for user input.
  • <input>: Defines an input control within a form.
  • <textarea>: Defines a multiline input control.
  • <button>: Defines a clickable button.
  • <select>: Defines a dropdown list.
  • <label>: Defines a label for an input element.

Attributes

In HTML, an attribute is additional information that is added to an HTML element to modify its behavior or provide extra information about the element. Attributes are used to customize the behavior, appearance, or functionality of HTML elements.

Attributes are always specified in the opening tag of an HTML element and are written as name-value pairs, where the name is the attribute name and the value is the value assigned to that attribute. They are separated from the element’s name by a space and are enclosed within the element’s opening tag in double or single quotes.

Here are some common attributes used in HTML tags:

1. Attributes related to Formatting and Styling:

  • class: Identifies a CSS class for an element, allowing CSS rules to be applied to that element.
  • id: Uniquely identifies an element within the document, often used for internal linking or targeting with JavaScript.
  • style: Defines inline CSS rules for the element.

2. Attributes related to Links and Addresses:

  • href: Specifies the URL address that a link will navigate to.
  • src: Specifies the URL address of a resource such as an image or audio/video file that an element will use.
  • alt: Provides alternative text for an image when the image cannot be displayed.
  • target: Specifies the target window or frame that a link will open in.

3. Attributes related to Forms and Inputs:

  • action: Specifies the destination (URL) of data sent from a form when it is submitted.
  • method: Specifies the HTTP method used when submitting data from a form (GET or POST).
  • name: Specifies the name of an element within a form.
  • type: Specifies the type of an input field in a form, such as text, email, password, checkbox, etc.
  • value: Specifies the default or current value of an input field.

4. Attributes related to Conditions and States:

  • disabled: Disables an element, making it unselectable or unclickable.
  • readonly: Sets an element as read-only, preventing users from changing its value.
  • required: Requires an input field in a form to be filled out before it can be submitted.
  • checked: Sets the checked state for an element such as a checkbox or radio button.

5. Other Attributes:

  • title: Specifies a title or description tooltip for an element.
  • aria-*: Accessibility attributes providing additional information for assistive technologies.
  • data-*: Custom attributes allowing storage of custom data within an HTML element.

These attributes help define and control how HTML elements are displayed and behave on a web page.

Leave a Comment

Share this Doc

HTML – Basic Knowledge

Or copy link

CONTENTS