• HTML
  • C# Tutorial
  • React
  • React Native
  • Angular
  • PHP Articles
  • HTML
  • C# Tutorial
  • React
  • React Native
  • Angular
  • PHP Articles
  • HTML Tutorial
  • HTML Styles – CSS
  • Link to an Email Address
  • HTML Introduction
  • HTML Editors
  • HTML Basic Examples
  • HTML Elements
  • HTML Attributes
  • HTML Headings
  • HTML Paragraphs
  • HTML Styles
  • HTML Text Formatting
  • HTML Quotation and Citation Elements
  • HTML Comments
  • HTML Colors
  • HTML RGB and RGBA Colors
  • HTML HEX Colors
  • HTML HSL and HSLA Colors
  • CSS Colors, Fonts and Sizes
  • CSS Padding
  • CSS Border
  • CSS Margin
  • Link to External CSS
  • HTML Style Tags
  • HTML Links
  • HTML Links – The target Attribute
  • Absolute URLs vs. Relative URLs
  • HTML Links – Use an Image as a Link
  • Button as a Link
  • Link Titles
  • Absolute URLs and Relative URLs
  • HTML Link Tags
  • HTML Links – Different Colors
  • Link Buttons
  • HTML Links – Create Bookmarks
  • The alt Attribute
  • HTML Images
  • Image Size – Width and Height
  • Image Width and Height, or Style
  • Images in Another Folder
  • HTML Images on Another Server/Website
  • HTML Animated Images
  • Image as a Link
  • Image Floating
  • Common Image Formats
  • HTML Image Tags
  • The render Method

HTML Tutorial

31445 views 307

Written by admin
April 15, 2023

HTML (Hypertext Markup Language) is the standard markup language used for creating web pages. It provides a structure and a standardized way of adding content to web pages. In this tutorial, we’ll cover the basics of HTML.

Getting Started

To create an HTML document, you need a text editor. Popular text editors include Notepad, Sublime Text, and Visual Studio Code. You can also use online editors like CodePen or JSFiddle.

To create an HTML document, start by opening a new file in your text editor. Save the file with a .html extension. For example, index.html.

Basic HTML Structure

Every HTML document has a basic structure that includes the following elements:

<!DOCTYPE html>
<html>
<head>
    <title>Page Title</title>
</head>
<body>

<!-- Page content goes here -->

</body>
</html>

Here’s what each element does:

  • <!DOCTYPE html>: This declaration tells the browser that the document is an HTML5 document.
  • <html>: This element is the root element of an HTML document.
  • <head>: This element contains meta information about the document, such as the title, CSS stylesheets, and JavaScript files.
  • <title>: This element sets the title of the document, which appears in the browser’s title bar.
  • <body>: This element contains the visible content of the document.

Adding Content

HTML documents are made up of HTML tags. Tags are enclosed in angle brackets, like <tagname>. Tags come in pairs, with an opening tag and a closing tag. The closing tag has a forward slash before the tag name, like </tagname>.

Here are some basic HTML tags:

<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<a href="https://www.example.com">This is a link</a>
<img src="image.jpg" alt="Image description">

Here’s what each tag does:

  • <h1>: This tag creates a heading. There are six levels of headings, from <h1> (the most important) to <h6> (the least important).
  • <p>: This tag creates a paragraph.
  • <a>: This tag creates a hyperlink. The href attribute specifies the URL of the link.
  • <img>: This tag inserts an image. The src attribute specifies the URL of the image, and the alt attribute provides a text description of the image.

Adding Structure

HTML tags can be used to add structure to a document. For example, you can use the <header>, <nav>, <main>, <article>, <section>, and <footer> tags to create a semantic structure for your page.

<header>
    <h1>My Website</h1>
    <nav>
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">About</a></li>
            <li><a href="#">Contact</a></li>
        </ul>
    </nav>
</header>

<main>
    <article>
        <h2>Article Title</h2>
        <p>Article content goes here.</p>
    </article>

    <section>
        <h2>Section Title</h2>
        <p>Section content goes here.</p>
    </section>
</main>

<footer>
    <p>&copy; 2023 My Website</p>
</footer>

Here’s what each tag does:

  • <header>: This tag creates a header section.

– <nav>: This tag creates a navigation section.

Was this helpful?

307 Yes  288 No
Related Articles
  • The render Method
  • HTML Image Tags
  • Common Image Formats
  • Image Floating
  • Image as a Link
  • HTML Animated Images

Didn't find your answer? Contact Us

Up Next
HTML Styles – CSS
Copyright 2022 k-window. All Rights Reserved
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage vendors Read more about these purposes
View preferences
{title} {title} {title}