HTML Basics for Beginners | HTML Tutorial

0

HTML Basics for Beginners: Your Step-by-Step Guide to Learning HTML

Welcome to CodaSnap! In this guide, we'll cover the HTML basics for beginners, helping you start your journey in web development. HTML or HyperText Markup Language, is the foundation of web pages, defining their structure and content, whether you're completely new to coding or looking to refresh your skills, this tutorial is for you.



What is HTML?

HTML Stands for HyperText Markup Language. It's used to create and structure sections, paragraph, and links on web pages. Learning HTML basics is essential for anyone interested in web development.

Why HTML?

HTML (HyperText Markup Language) is the foundation of all web pages. It provides the structure and content for websites, which are then styled with CSS and made interactive with JavaScript. Let's dive into creating your first HTML page.

Setting Up Your Environment

Before diving into HTML, you'll need a text editor. Here are some recommendations:

  • Visual Studio Code (VSCode):                               Download here
  • Sublime Text:                                                              Download Here
  • Atom:                                                                             Download here

Basic Structure of an HTML Document

Every HTML document starts with a <!DOCTYPE html> declaration, followed by <html>, <head> and <body> tags. Here's a simple example:

 

HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, intial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>Welcome to my First Webpage.</h1>
    <p>This is a Paragraph.<p>
</body>
</html>

 

Creating Your First HTML Page

  1. Open your text editor and create a new file. Save it as index.html
  2. Type the example code above into your file.
  3. Save the file and open it in your web browser by double-clicking it. You should see your first webpage!

Basic HTML Tags

1. HTML Document Structure:

  • <!DOCTYPE html>: Declares the document type and version of HTML.
  • <html>: The root element of an HTML page.
  • <head>: Contains meta-information about the document (e.g., title, meta tags).
  • <body>: Contains the content of the document visible to users.

2. Essential Tags: 

  • <title>: Sets the title of the webpage, displayed on the browser tab.
  • <h1> to <h6>: Define headings, <h1> being the highest level and <h6> the lowest.
  • <p>: Defines a paragraph.
  • <a href="URL">: Creates a hyperlink.
  • <img src="URL" alt="description">: Embeds an image.
  • <ul>: Creates an unordered (bulleted) list.
  • <ol>: Creates an ordered (numbered) list.
  • <li>: Defines a list item.

Building a Simple Webpage

Let's combine these elements to create a simple webpage:

 

HTML
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, intial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>Welcome to my Simple Webpage.</h1>
    <p>This is a Paragraph of text. HTML is Fun!<p>
    <h2>Here are some of my favorite links:</h2>
    <ul>
    	<li><a href:="https://www.google.com">Google</a><li>
        <li><a href:="https://www.facebook.com">Facebook</a><li>
        <li><a href:="https://www.youtube.com">Youtube</a><li>
	<ul>
    <h2>My favorite Image</h2>
    <img src="Path/to/the/Image" alt="Image Description">
</body>
</html>

 

Next Steps

Now that you've learned the HTML basics for beginners and created your first HTML page, here are a few things to try next:

  • Practice: Create more webpages with different structures and elements.
  • Experiment: Play around with different HTML tags and attributes to see what they do.
  • Learn More: Check out resources like MDN Web Docs for in-depth tutorials and references.

 Conclusion

In this guide, we covered the HTML basics for beginners, including setting up your environment, writing your first HTML page, and using essential HTML tags. Now let's go to the next chapter HTML Elements where you will learn more about HTML tags and Attributes, Comments, Text Formatting and more. But I also encourage you to practice and explore more on your own. If you have any questions or need further clarification, feel free to leave a comment below. Till then keep learning. Keep coding!

Post a Comment

0Comments

Post a Comment (0)