HTML all resources
HTML all resources
HTML has a comprehensive set of tags and elements, each serving specific purposes in
structuring and presenting web content. Below is a categorized list of all commonly used
HTML elements as of the latest HTML5 standard:
HTML basics and Exemples
Basic Document Structure
Metadata Elements
Content Sectioning
Text Content
<p>: Paragraphs.
<span>: Inline container for text.
<a>: Hyperlink.
<strong>: Strong importance (bold by default).
<em>: Emphasized text (italic by default).
<b>: Bold text (without implying importance).
<i>: Italic text (without implying emphasis).
<mark>: Highlighted text.
<small>: Smaller text.
<abbr>: Abbreviation or acronym.
<time>: Time or date.
<q>: Short inline quotation.
<blockquote>: Long quotation.
<cite>: Citation.
<code>: Inline code.
<pre>: Preformatted text.
<br>: Line break.
<hr>: Horizontal rule (thematic break).
Lists
Tables
Embedded Content
<img>: Image.
<audio>: Audio content.
<video>: Video content.
<source>: Media source (for <audio> or <video>).
<track>: Subtitles or captions for <video> and <audio>.
<iframe>: Inline frame (embed another document).
<embed>: Embedded external content.
<object>: Embedded object (e.g., multimedia).
<param>: Parameters for <object>.
Scripting
Semantic Elements
Interactive Elements
This list includes all significant HTML5 elements. If you'd like detailed examples or
explanations for any specific tag, let me know!
1. <html>
html
Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>
2. <head>
html
Copy code
<head>
<title>My Page</title>
<meta charset="UTF-8">
</head>
3. <body>
html
Copy code
<body>
<h1>Welcome!</h1>
<p>This is a webpage.</p>
</body>
Metadata Elements
1. <meta>
html
Copy code
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
2. <title>
html
Copy code
<title>My Awesome Page</title>
3. <link>
html
Copy code
<link rel="stylesheet" href="styles.css">
4. <style>
html
Copy code
<style>
body {
background-color: lightblue;
}
</style>
5. <base>
html
Copy code
<base href="https://example.com/">
<a href="about.html">About</a> <!-- Resolves to
https://example.com/about.html -->
6. <script>
html
Copy code
<script>
console.log("Hello, World!");
</script>
Content Sectioning
1. <header>
html
Copy code
<header>
<h1>Site Title</h1>
<nav>
<a href="#home">Home</a>
<a href="#about">About</a>
</nav>
</header>
2. <footer>
html
Copy code
<footer>
<p>© 2024 My Website</p>
</footer>
3. <main>
html
Copy code
<main>
<article>
<h2>Blog Post</h2>
<p>This is a blog post.</p>
</article>
</main>
4. <section>
html
Copy code
<section>
<h2>About Us</h2>
<p>We are a web development company.</p>
</section>
5. <article>
html
Copy code
<article>
<h2>Breaking News</h2>
<p>Something exciting happened today!</p>
</article>
6. <aside>
html
Copy code
<aside>
<p>Related content or advertisements.</p>
</aside>
7. <nav>
html
Copy code
<nav>
<a href="#home">Home</a>
<a href="#services">Services</a>
</nav>
8. <h1> to <h6>
html
Copy code
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Section Title</h3>
Text Content
1. <p>
html
Copy code
<p>This is a paragraph of text.</p>
2. <span>
html
Copy code
<span style="color: red;">Highlighted text</span>
3. <a>
html
Copy code
<a href="https://example.com">Visit Example</a>
4. <strong>
html
Copy code
<strong>Important text</strong>
5. <em>
html
Copy code
<em>Emphasized text</em>
6. <b>
html
Copy code
<b>Bold text</b>
7. <i>
html
Copy code
<i>Italic text</i>
8. <mark>
html
Copy code
<mark>Highlighted text</mark>
9. <small>
html
Copy code
<small>Small print text</small>
10. <abbr>
html
Copy code
<abbr title="HyperText Markup Language">HTML</abbr>
11. <time>
html
Copy code
<time datetime="2024-12-12">December 12, 2024</time>
12. <q>
html
Copy code
<q>Inline quotation text</q>
13. <blockquote>
html
Copy code
<blockquote>
This is a long block quote.
</blockquote>
14. <cite>
html
Copy code
<cite>Author Name</cite>
15. <code>
html
Copy code
<code>console.log("Hello, World!");</code>
16. <pre>
html
Copy code
<pre>
function foo() {
return "bar";
}
</pre>
17. <br>
html
Copy code
Line 1<br>Line 2
18. <hr>
html
Copy code
<hr>
Lists
html
Copy code
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
2. <ol>
html
Copy code
<ol>
<li>Step 1</li>
<li>Step 2</li>
</ol>
html
Copy code
<dl>
<dt>Term</dt>
<dd>Definition</dd>
</dl>
1. <form>
html
Copy code
<form action="/submit" method="post">
<input type="text" name="name">
<button type="submit">Submit</button>
</form>
2. <input>
html
Copy code
<input type="email" placeholder="Enter your email">
3. <textarea>
html
Copy code
<textarea rows="4" cols="50"></textarea>
4. <button>
html
Copy code
<button>Click Me</button>
Media Elements
1. <img>
html
Copy code
<img src="image.jpg" alt="Sample image">
2. <audio>
html
Copy code
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
</audio>
3. <video>
html
Copy code
<video controls>
<source src="video.mp4" type="video/mp4">
</video>
4. <iframe>
html
Copy code
<iframe src="https://example.com"></iframe>
IMPLEMENT CSS in HTML
CSS (Cascading Style Sheets), you can style HTML elements by applying
rules that specify the appearance of those elements. CSS can be applied in
three main ways: inline, internal, and external. Below is a guide with
examples for each method:
1. Inline CSS
Style is applied directly to an individual HTML element using the style attribute.
Example:
html
Copy code
<!DOCTYPE html>
<html>
<head>
<title>Inline CSS Example</title>
</head>
<body>
<h1 style="color: blue; font-size: 24px;">Hello, World!</h1>
<p style="background-color: yellow; padding: 10px;">This is a paragraph
with inline CSS.</p>
</body>
</html>
2. Internal CSS
Style rules are placed within a <style> tag inside the <head> section of the HTML
document.
Example:
html
Copy code
<!DOCTYPE html>
<html>
<head>
<title>Internal CSS Example</title>
<style>
body {
background-color: lightgray;
}
h1 {
color: green;
font-family: Arial, sans-serif;
}
p {
color: white;
background-color: black;
padding: 15px;
border-radius: 5px;
}
</style>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This paragraph is styled using internal CSS.</p>
</body>
</html>
3. External CSS
Styles are written in a separate .css file, which is linked to the HTML document
using a <link> tag in the <head>.
Example:
HTML File:
html
Copy code
<!DOCTYPE html>
<html>
<head>
<title>External CSS Example</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>External CSS Styling</h1>
<p>This is styled using an external CSS file.</p>
</body>
</html>
css
Copy code
body {
font-family: 'Verdana', sans-serif;
background-color: #f4f4f9;
margin: 0;
padding: 0;
}
h1 {
color: #333;
text-align: center;
margin-top: 20px;
}
p {
color: #555;
padding: 10px 20px;
background-color: #eee;
border-left: 5px solid #ccc;
}
4. CSS Selectors
CSS rules consist of a selector and a declaration block. Here are some common selectors:
.class
Targets elements with a specific .button { color: blue; }
class
#id
Targets an element with a specific #header { text-align: center; }
ID
h1, p { font-family: sans-
element,element Targets multiple elements serif; }
element element Targets descendant elements div p { color: gray; }
5. Advanced Techniques
css
Copy code
a:hover {
color: red;
}
input:focus {
border: 2px solid blue;
}
css
Copy code
p::first-line {
font-weight: bold;
}
css
Copy code
@media (max-width: 600px) {
body {
background-color: lightblue;
}
}
By combining these methods and techniques, you can create visually appealing and
responsive web pages.