Free Ebook cover Complete HTML, CSS and Javascript course to become a Front End Developer

Complete HTML, CSS and Javascript course to become a Front End Developer

3.79

(14)

125 pages

Introduction to HTML: basic structure, tags and attributes: Introduction to HTML

Capítulo 5

Estimated reading time: 3 minutes

Audio Icon

Listen in audio

0:00 / 0:00
4.1. Introduction to HTML: basic structure, tags and attributes

Introduction to HTML

HTML (HyperText Markup Language) is the main language for creating websites and web applications. It is not a programming language, but a markup language. HTML allows you to structure your web page, add content, and make text display how you want. It is the backbone of any website and is an essential skill for any front-end developer.

Basic structure of HTML

A basic HTML document has a specific structure that includes the following parts:

  • Doctype: The first line of any HTML document is the doctype declaration. It tells the browser what type of document to expect. In HTML5, the doctype declaration is very simple: ``.
  • HTML Element: The HTML element is the root element of an HTML page. All other elements must be descendants of this element.
  • Head Element: The head element contains metadata (data about the data) that is not displayed on the web page itself, but is machine readable. It typically contains the page title and links to scripts and stylesheets.
  • Body Element: The body element contains the main content of the web page, which is displayed in the browser.

HTML Tags

HTML tags are the main syntax of HTML. They are used to create HTML elements and consist of a tag name surrounded by angle brackets. HTML tags come in pairs, which consist of an opening tag and a closing tag.

For example, here is a paragraph tag: `

This is a paragraph.

`. The opening tag is `

` and the closing tag is `

Continue in our app.

You can listen to the audiobook with the screen off, receive a free certificate for this course, and also have access to 5,000 other free online courses.

Or continue reading below...
Download App

Download the app

`. The content inside the tags is the content of the element.

HTML Attributes

HTML attributes are used to add additional information to HTML elements. They come in name-value pairs and are placed inside the opening tag of an element.

For example, here is an image element with a src attribute: ``. The attribute name is "src" and the attribute value is "image.jpg". This attribute tells the browser where to find the image that should be displayed.

Conclusion

This is a basic introduction to HTML. Learning HTML is the first step towards becoming a web developer. However, HTML is just the tip of the iceberg. To create interactive and dynamic websites, you will also need to learn CSS and JavaScript. But don't worry, we'll cover these topics in detail in the next chapters.

Now answer the exercise about the content:

What is the function of the "src" attribute in an HTML image tag?

You are right! Congratulations, now go to the next page

You missed! Try again.

The src attribute in an HTML image tag specifies the location (URL) of the image file to be displayed. It informs the browser where to retrieve the image from so that it can be rendered on the webpage.

Next chapter

Introduction to HTML: basic structure, tags and attributes: Basic structure of HTML

Arrow Right Icon
Download the app to earn free Certification and listen to the courses in the background, even with the screen off.