HTML Introduction
HTML is the standard markup language for creating Web pages.
Introduction to HTML:
- What is HTML?
- The role of HTML in web development.
HTML, which stands for HyperText Markup Language, is the standard markup language used to create the structure and content of web pages. It is a fundamental building block of web development. HTML consists of a series of elements, each represented by a tag, which defines the structure and content of different parts of a web page.
HTML plays a fundamental role in web development by providing the structure and foundation for creating web pages. Its primary functions and roles in web development include:
Setting Up Your Development Environment:
- Text editors (e.g., Visual Studio Code, Sublime Text).
- Web browsers for testing (e.g., Chrome, Firefox).
Basic HTML Document Structure:
- <!DOCTYPE html>
- <html>element
- <head> and <title> elements
- <body> element
HTML Elements:
- Understanding HTML tags
- Common HTML elements (e.g., headings, paragraphs, lists).
Attributes:
- Adding attributes to HTML elements.
- Common attributes (e.g., id, class, src).
Links and Navigation:
- Creating hyperlinks with <a> tag.
- Linking to internal and external pages.
- Navigation using lists (<ul>, <ol>, <li>).
Images:
- Embedding images with the <img> tag.
- Using attributes for images (e.g., src,alt)
Forms:
- Building forms with <form> tag.
- Form elements (e.g.,<input>, <textarea>, <select>).
- Form attributes (e.g., action, method).
Semantic HTML:
- Introduction to semantic elements (e.g., <header>, <footer>, <section>).
- Improving accessibility with semantic tags.
HTML5 Features:
- New elements in HTML5 (e.g.,<article> , <nav>, <figure>)
- Multimedia elements (e.g., <audio>, <video>)
Validation and Best Practices:
- Using validators to check HTML code.
- Best practices for clean and maintainable code.
Responsive Web Design
- .
- Introduction to responsive design.
- Using viewport meta tag.
- Media queries for responsive styles.
Basic CSS Integration:
- Linking CSS stylesheets to HTML.
- Basic styling concepts (e.g., colors, fonts).
Additional Resources:
- Online documentation and references.
- Further learning paths (e.g., CSS, JavaScript).
Practice Exercises:
- .
- Hands-on exercises to reinforce learning.
For practical learning, it's recommended to code along with the examples and create your own simple web pages. As you become more comfortable with HTML, you can explore other web development technologies like CSS for styling and JavaScript for interactivity. Numerous online platforms and resources provide interactive coding environments and exercises to enhance your skills.
Example Explained
- The < !DOCTYPE html > declaration defines that this document is an HTML5 document
- The < html > element is the root element of an HTML page
- The < head > element contains meta information about the HTML page
- The < title > element specifies a title for the HTML page (which is shown in the browser's title bar or in the page's tab)
- The < 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.
- The < h1 > element defines a large heading
- The < p > element defines a paragraph
What is an HTML Element?
An HTML element is defined by a start tag, some content, and an end tag:
<tagname> Content goes here... </tagname>
The HTML element is everything from the start tag to the end tag:
<h1>My First Heading</h1>
<p>My first paragraph.</p>
Start tag | Element content | End tag |
---|---|---|
<h1> | <p> | <br> |
My First Heading | My first paragraph. | none |
</h1> | </p> | none |
Note: Some HTML elements have no content (like the <br> element). These elements are called empty elements. Empty elements do not have an end tag!
HTML Page Structure
<html>
<head>
</head>
<body>
</body>
</html>
Note: The content inside the <body> section will be displayed in a browser. The content inside the <title> element will be shown in the browser's title bar or in the page's tab.
HTML History
Since the early days of the World Wide Web, there have been many versions of HTML:
Year | Version |
---|---|
1898 | Tim Berners-Lee invented "World Wide Web". |
1991 | Tim Berners-Lee released the first version of the HTML specification (HTML 1.0). |
1993 | drafted the HTML+ specification, which was an extension of the original HTML (HyperText Markup Language). |
1995 | HTML Working Group defined HTML 2.0 |
1997 | The HTML 4.0 specification was released by These day |
1999 | HTML 4.01 was the prevalent version during this time |
2008 | The Web Hypertext Application Technology Working Group (WHATWG) started the HTML5 initiative |
2010 | HTML5 Standardization : HTML5 standardization process from WHATWG. |
2012 | WHATWG HTML5 Living Standard |
2014 | Recommendation: HTML5 |
2016 | Candidate Recommendation: HTML 5.1 |
2017 | Recommendation: HTML5.1 2nd Edition |
2019 | HTML Living Standard: The "HTML Living Standard," reflecting its continuous evolution rather than periodic version updates. |
This tutorial follows the latest HTML5 standard.