Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.

Get Started Now!

HTML Basic Structure

HTML Documents:

All HTML documents must start with a document type declaration: <!DOCTYPE html>.

The HTML document begins with <html> and ends with </html>.

The visible part of the HTML document is between <body> and </body>.

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

Where,

  • <!DOCTYPE html> Element defines document types (Like HTML5 document).
  • <html> html element define the root element of an HTML page.
  • <head> Head elements contains meta information about the HTML page
  • <title> Title element specifies a title for the HTML page.
  • <body> Body element defines the document’s body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
  • <h1> Heading element defines a large heading.
  • <p>  Paragraph element defines a paragraph.

What is the difference between tags and elements ?

Tag means the text surrounding by angular bracket is called tags.

Ex: <p> </p>

Element means the combination of tag and text is called elements.

Ex: <p> Welcome to html code</p>

HTML Attributes:

Html attribute is a word which gives additional information about html tags or elements.

Always we have to write the attribute inside the opening tag only.

Syntax: attribute name= “attribute value”

Example: align, style, href, src, alt, … etc.

Align: This attribute is used for left, right & center.

<!DOCTYPE html>
<html lang="en">
<head>
   
    <title>Attribute</title>
</head>
<body>

    <p Align = "center">Good Morning</p>
    <h1 style="color: crimson;" Align = "center">Hello World </h1>
    
</body>
</html>

Output:

Related Posts

How to Run an HTML Website Alongside a Laravel Project on the Same Server

Running a Laravel application is common for dynamic web platforms, dashboards, and APIs. However, many businesses and developers also want to run a simple HTML website on Read More

Read More

What is HTTP and What is top use cases of HTTP ?

What is HTTP ? HTTP, or Hypertext Transfer Protocol, is an application layer protocol used primarily with the World Wide Web in the client-server model. It was Read More

Read More

Understanding SEO: Exploring Its Principles and Varied Types

Introduction to SEO SEO stands for Search Engine Optimization. It’s the process of improving your website to increase its visibility in search engine results pages (SERPs). In Read More

Read More

Creating Simple HTML Form

Job Application Form Using HTML Output:

Read More

HTML Headings:

HTML heading describe what type of heading given in html pages. There are six type of html headings using in html Syntax: <h1> This is heading 1 Read More

Read More

Why html is markup language?

In HTML, We are writing the code in tags format and all the tags are predefine that why html is markup language. Tag: Tag, The text which Read More

Read More
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x