Certainly! Let me provide explanations for each HTML element and attribute included in the extended cheat sheet:
- Headings:
<h4>This is a Heading 4</h4>
<h5>This is a Heading 5</h5>
<h6>This is a Heading 6</h6>
Headings are used to define headings in HTML. They range from <h1>
(largest) to <h6>
(smallest).
- Paragraph Formatting:
<p><strong>Bold Text</strong></p>
<p><em>Italic Text</em></p>
<p><u>Underlined Text</u></p>
HTML provides tags like <strong>
, <em>
, and <u>
for emphasizing text in different ways.
- Line Break:
<p>This is<br> a line break</p>
The <br>
tag is used to insert a line break within text.
- Horizontal Line:
<hr>
<hr>
creates a thematic break or horizontal line.
- Links with Target:
<a href="https://www.example.com" target="_blank">Open in a new tab</a>
The target="_blank"
attribute opens the link in a new browser tab.
- Lists with Descriptions:
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
<dl>
is used for description lists, where <dt>
is a term and <dd>
is its description.
- Ordered List Types:
<ol type="A">
<li>Item A</li>
<li>Item B</li>
</ol>
The type
attribute allows you to specify the type of ordered list (A, a, I, i).
- Images with Width and Height:
<img src="image.jpg" alt="Description" width="300" height="200">
<img>
is used to embed images. The width
and height
attributes set the dimensions.
- Form Input Types:
<input type="text" placeholder="Text Input">
<input type="checkbox" id="checkbox"> <label for="checkbox">Checkbox</label>
<input type="radio" id="radio" name="radio"> <label for="radio">Radio Button</label>
Various input types (text
, checkbox
, radio
) for form elements.
- Textarea:
<textarea rows="4" cols="50" placeholder="Enter text here..."></textarea>
<textarea>
creates a multiline text input field.
- Select Dropdown:
<select>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
</select>
<select>
creates a dropdown list, and <option>
defines the options within the list.
- Table with Caption:
<table>
<caption>Table Caption</caption>
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1, Cell 1</td>
<td>Row 1, Cell 2</td>
</tr>
</tbody>
</table>
<table>
is used to create a table, and <caption>
provides a title for the table.
- Span for Inline Styling:
<p>This is <span style="color: red;">red</span> text.</p>
<span>
is used for inline styling. In this example, it changes the text color to red.
- HTML Entities:
<p>© 2023 Your Company ®</p>
HTML entities like ©
(copyright) and ®
(registered trademark) represent special characters.
- Comment within the HTML:
<!-- This is a comment within the HTML code -->
<!-- ... -->
is used to add comments in HTML, which are not displayed in the browser.
These explanations should help you understand the purpose and usage of each element and attribute in the provided HTML cheat sheet.