What is HTML?

HTML stands for Hypertext Markup Language. Hypertext refers to text (numbers, characters, symbols) that can be linked and accessed via a browser. Markup Language is a set of tags used to structure and style text, enabling communication with web browsers. In practice, HTML provides the foundation for building web pages.

The difference between a book and a web page is the medium: paper vs. screen. Both are formatted and structured to convey meaning.

General Syntax of HTML Attributes

HTML attributes always have a name and a value. Some attribute names can also take more than one value.

Attributes define extra properties of an HTML element and are used for referencing or styling. The most common attributes include:

  • id – uniquely identifies an element and its content.
    <p id="main">The id is the attribute name, while "main" is its value.</p>
  • class – groups elements for styling with CSS.
    <p class="boys girls">The class is the attribute name, while "boys" and "girls" are its values.</p>
    You can see that the p element has more than one value that can be used for styling.
  • style – applies inline CSS directly to an element.
    <p style="font-style:oblique;">The "style" is the attribute name, while the value is "font-style:oblique;".</p>
    You will learn more about style attribute name when we cover CSS. 
  • title – provides a tooltip description when you hover over the element it's applied to.
    <p title="A paragraph">The title is the attribute name, while the value is "A paragraph".</p>

Example of a two-sided tag:

<p align="center">This is a paragraph</p>
HTML is not case-sensitive, but W3C recommends using lowercase for cleaner code.

Example of a void (self-closing) tag:

<img src="logo.png" alt="Site Logo" />

As you can see, both elements have an attribute name and an assigned value:

  • tag - the name of the element.
  • name - the attribute name (e.g., align, src, and alt).
  • value - the assigned setting (e.g., "center", "logo.png", "Site Logo").
Web design is like building a house in the virtual world - it requires thorough planning and structure.

No comments

Theme images by mammuth. Powered by Blogger.