0% found this document useful (0 votes)
7 views

What is HTML

HTML, or HyperText Markup Language, is the foundational language for creating websites, instructing web browsers on how to display content. Every website is built using HTML, making it essential for web development and understanding internet structure. A basic HTML document consists of a doctype declaration, html, head, and body tags, where the head contains metadata and the body contains visible content.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

What is HTML

HTML, or HyperText Markup Language, is the foundational language for creating websites, instructing web browsers on how to display content. Every website is built using HTML, making it essential for web development and understanding internet structure. A basic HTML document consists of a doctype declaration, html, head, and body tags, where the head contains metadata and the body contains visible content.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

What is HTML?

● HTML stands for HyperText Markup Language.


○ It’s a special language that tells web browsers (like Chrome or Firefox) how to
display websites.
○ Think of it as the building blocks or Lego pieces for making a webpage!

Why is HTML Important?


● Every website on the internet is built using HTML.
○ Learning HTML is the first step to creating your own webpage.
○ It helps you understand how information is structured on the internet.

Basic Structure of an HTML Document


● Starting with <!DOCTYPE html>:
○ This line tells the browser that the file is written in HTML5.
● The <html> Tag:
○ This tag wraps all the content of your webpage.
● Inside <html>, there are two main sections:
○ <head> Section:
■ Contains information about your webpage (like its title).
○ <body> Section:
■ Contains all the content you see on the page (like text, pictures, and
links).

Understanding Tags and Elements


● Tags are like instructions:
○ They tell the web browser what to do.
● Tags usually come in pairs:
○ For example, <p> starts a paragraph and </p> ends it.
● Elements:
○ An element is a complete tag and its content, for example:
<p>This is a paragraph.</p>
Writing Your First HTML File
1. Open a Text Editor:
○ You can use Notepad (on Windows) or TextEdit (on Mac).
2. Type the Basic HTML Code:
○ Write the structure with <!DOCTYPE html>, <html>, <head>, and <body>.
3. Save Your File:
○ Name it something like index.html (make sure it ends with .html).
4. Open Your File in a Web Browser:
○ Double-click the file to see your very first webpage!

Example of a Simple HTML File


html
Copy
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to my first HTML page.</p>
</body>
</html>

● Explanation:
○ <!DOCTYPE html> tells the browser that this is an HTML5 file.
○ <html> starts the document.
○ <head> contains information like the title, which appears on the browser tab.
○ <body> contains what you see on the webpage, such as headings and
paragraphs.
○ <h1> is a heading (a big title).
○ <p> is a paragraph for regular text.

1. Open Notepad
● Click the Start menu.
● Type Notepad and click on the app to open it.

2. Write Your HTML Code


● In Notepad, type your HTML code.
● For example, you can start with this basic structure:

html
Copy
<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>Welcome to my webpage!</p>
</body>
</html>

● Explanation:
○ <!DOCTYPE html> tells the browser that you're using HTML5.
○ <html> is the container for all your webpage content.
○ <head> contains meta-information, like the title of your page.
○ <body> contains what you see on the webpage, like headings and paragraphs.

3. Save the File


● Click File in the menu, then Save As...
● Choose a location where you want to save your file.
● Name your file something like index.html.
● In the Save as type dropdown, select All Files so that Notepad doesn't add a .txt
extension.
● Click Save.

4. View Your Webpage in a Browser


● Navigate to the folder where you saved your file.
● Double-click index.html.
● Your default web browser will open, and you’ll see your new webpage!

You might also like