Introduction to HTML for beginners
Introduction to HTML for beginners

Introduction to HTML for beginners

A beginners guide to web development. If you’ve always wanted to learn how to build a website, then you’ve come to the right place!

A website comprises of multiple webpages and how do we build a webpage? Yes, using HTML, CSS, and JavaScript. Today, we’ll focus on understanding the role of HTML in a website.

Table of contents

  • What is HTML and Why Use It?
  • Fundamental Elements of HTML
  • How to Write Basic HTML Code
  • How HTML is Used for Building a Webpage
  • Commonly Used HTML Tags & Elements
  • How to Debug HTML?
  • HTML Versions
  • Additional Resources
  • Queries and Further Tasks
  • Task to Take Home



What is HTML and Why to use it

HTML stands for HyperText Markup Language. While the full form might seem daunting, think of HTML like the human skeleton. Just as bones provide structure to the body, HTML provides the structure to organize content on a webpage. It’s a markup language that defines the layout and content placement through tags.



Fundamental Elements of HTML

HTML’s basic building blocks include:

  1. Tags: Tags are fundamental units of HTML that define the structure and content of a webpage. They are enclosed in angle brackets (“<” and “>”).
  2. Attributes: These provide additional information about HTML tags and are specified within the opening tag of an element.
  3. Text Content: This refers to the content visible to users on a webpage, specified using tags like headings and paragraphs


How to Write Basic HTML Code

Let’s write some basic HTML together:

  1. Open any text editor (e.g., Notepad, Sublime, VS Code).
  2. Create a file and copy the below code snippet into it.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Introduction to HTML</title>
</head>
<body>
    <h1>Introduction to HTML</h1>
    <div style="background-color:cornsilk"> I create a container</div>
    <br/>
    <span style="background-color: yellow;">I create an inline contaner</span>
    <br/>
    <br/>
    <a href="https://www.dhirubhai.net/in/nehagupta1504/">Connect with me by clicking on it</a>
    <br/>
    <br/>
    <footer style="background-color: beige;">@NehaGupta</footer>
</body>
</html>        

3. Save the file with a .html or .htm extension.

4.Double click the file or open it with a web browser.

How to create an HTML file



HTML Page Structure

  • <!DOCTYPE HTML>: Declares the document as HTML and specifies its version. It ensures the browser renders the page correctly.
  • <html>: The root element containing all other elements.
  • <head>: Contains meta-information about the HTML document, such as its title, character set, stylesheets, scripts, and more.
  • <meta>:The <meta> tags provide metadata about the HTML document, such as the character set, viewport settings, author information, etc.
  • <title>: Specifies the webpage title.
  • <style>: Defines styling for the webpage.
  • <body>: Encloses content visible to users.
  • <script>: Loads JavaScript into the webpage for functionality.

Note: If you have any difficulty in understanding these terms don’t worry will look into these in more detail till then you can always look into additional resources link I provided in the below section



Commonly Used HTML Tags

We have gone through with the structure let’s look into some of the commonly used tags

<div> For creating containers </div>

<span> for creating inline containers </span>

<a href="some-url"> To link one webpage to other</a>

<img src="some-url"/> // To attach image in a webpage

<h1> Biggest heading </h1>

<h6> Smallest heading </h6>

<form> To create forms on a webpage </form>        

You can read about these tags more on w3school try using different tags in the webpage we’ve created.



How to debug HTML

We can leverage dev tools to do that. Checkout the attached video to do that or simply follow the steps below.

  • Go to your webpage
  • Right click and click on inspect
  • Click on the inspector and hover on the element you want to see in your webpage

Debugging HTML using Developer Tools



HTML Versions

HTML5 is the latest standard version used for web development.

Evolution of HTML



Additional Resources

We’ve mostly covered everything about HTML in this post. You can go through these additional resources if you need any further insights of how HTML works.

  1. HTML exercise
  2. HTML editors
  3. Tables , Forms


Queries and Further Tasks

You are now ready to structure a webpage of your own. If you have any queries regarding the HTML or this POST you can comment down below. Additionally you can connect with me on Linkedin or reach me out through Topmate. Please do gives a thumbs up and follow me here if you like this post and encourage me to keep making it.



Task to Take Home

  • Design a webpage for your portfolio.
  • Include headings, sections for experiences and projects, and a small form for user queries.
  • Share your progress on LinkedIn and tag me.


Harsh Tiwari

Product @Utkarsh Classes (JV : Physicswallah) | Co-founder @Planet Creatos

1 年

Sounds Amazing!

YASH JAIN

Senior Backend & AI Engineer @Quantzig | Ex - Dell | Mentor | YouTuber | 15k+ Followers

1 年

Awesome article ?? Neha

要查看或添加评论,请登录

Neha Gupta的更多文章

社区洞察

其他会员也浏览了