Basics HTML Codes and Definitions
Jobify
July 18, 2024
IT Knowledge
Structure and Definition:
- <!DOCTYPE html>: This declaration at the very beginning defines the document type as HTML5.
- <html>: This tag marks the root element of the HTML document.
- <head>: This section contains meta information about the page not displayed directly, like the title.
- <title>: This tag defines the title of the webpage, displayed on the browser tab.
- <body>: This section contains the content that will be displayed on the webpage.
Headings:
- <h1> to <h6>: These tags define headings of varying importance, with <h1> being the most important and <h6> the least.
Content and Breaks:
- <p>: This tag defines a paragraph of text.
- <br>: This tag inserts a single line break.
- <hr>: This tag inserts a horizontal line for separation.
Links:
- <a>: This tag creates a hyperlink. Text between the opening and closing tag becomes clickable, with the href attribute specifying the destination URL.
Lists:
- <ul>: This tag defines an unordered list, where items are not prioritized.
- <ol>: This tag defines an ordered list, where items are displayed with numbering.
- <li>: This tag defines a list item within <ul> or <ol>.
Images and Media:
- <img>: This tag embeds an image file. The src attribute specifies the image source path.
Tables:
- <table>: This tag defines a table structure.
- <tr>: This tag defines a table row.
- <td>: This tag defines a table cell containing data.
Grouping and Styling:
- <div>: This generic tag defines a division or section of content. It's often used for applying styles with CSS.
- <span>: This tag defines an inline element for applying styles to a specific portion of text without affecting the document structure.
Additional Notes:
- Most HTML tags come in pairs, with an opening tag (<tag>) and a closing tag (</tag>).