Introduction-to-HTML (2)
Introduction-to-HTML (2)
HTML
HTML (Hypertext Markup Language) is the standard markup
language used to create and structure web pages. It
provides the foundation for building the content, layout, and
interactive elements of websites. Understanding HTML is
crucial for any web development project, as it enables
developers to create engaging and functional online
experiences.
The doctype declaration The head section contains The body section holds the
specifies the version of HTML metadata, such as the page visible content of the web page,
used in the document, ensuring title, character encoding, and including headings, paragraphs,
proper rendering by web links to external resources like images, links, and other
browsers. CSS and JavaScript files. elements.
HTML Headings
1 h1
The top-level heading, used for the main title or
topic of the page.
2 h2-h6
Subheadings that provide structure and hierarchy
to the content.
3 Semantic Meaning
Headings convey the importance and organization
of the content, not just the visual styling.
HTML Paragraphs and Text
Formatting
Paragraphs Text Formatting
The <p> tag is used to HTML provides various tags
create paragraphs of text on like <b>, <i>, and <u> to
a web page. style text with bold, italic,
and underline, respectively.
Using the <ul> tag, unordered Ordered lists, created with the Definition lists, marked up with
lists display items with bullet <ol> tag, number the list items <dl>, are used to create a list of
points. sequentially. terms and their definitions.
HTML Links
Buttons
The <button> tag creates interactive buttons for
form submission and other actions.
Form Validation
HTML5 introduced built-in form validation
attributes to ensure data integrity.
HTML Semantic Elements
header Defines the header of a
document or section
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is a paragraph of text.</p>
<ul>
<li>List item 1</li>
<li>List item 2</li>
</ul>
<a href="https://example.com">Click me</a>
<img src="image.jpg" alt="My Image">
</body>
</html>