html-tutorial

HTML Concepts for beginners

This project is maintained by pushdev-code

HTML basics

HTML (HyperText Markup Language) is the language in which most websites are written. It defines the meaning and structure of web content. It is used to describe the content of a document so it can be read by browsers in the internet or offline.

is HTML a programming language?

HTML is a way of adding context and structure to text, therefore some people don’t consider it a programming language, because “a programming language is a notation for writing programs, which are specifications of a computation or algorithm” When you code HTML, you’re denoting a piece of data, You haven’t “instructed” the browser to execute a task.

How to write HTML Tags

HTML Tag Structure

The main parts of our element are as follows:

Besides from the previous parts, Tags can have attributes that contain more information about the content, they usually won’t be visible in the document:

HTML Tag attributes

An attribute should always have the following:

HTML tag can contain other tags and this called Nesting.

<p>My cat is <strong>very</strong> grumpy.</p>

Some HTML tags like <img> can be empty and not contain other tags. They usually are self enclosed (They don’t need the closing tag) as well:

<img src="images/firefox-icon.png" alt="My test image">

Source: https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/HTML_basics

Basic HTML file structure

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta charset="utf-8">
    <title>My HTML page</title>
  </head>
  <body>
    <p>This is my HTML page</p>
  </body>
</html>

Exercise

Create an HTML document and see it live in your browser.

  1. Inside your fork html-tutorial repo, under the 1-the-basics folder, create a file named basic.html Don’t forget to include the .html extension
  2. Copy the contents of the HTML file structure from above into the html file
  3. Put your name inside the <title> and in the <p> tags
  4. Save your changes and double click your file
  5. Your file should be visible in the browser and look similar to this image:
  6. Push the changes to your local copy of the repo.

HTML structure exercise