What is probably the most essential part of an HTML program,
the <!DOCTYPE> element must always be the first line in an HTML file.
This element tells the browser to render the page in standards-compliant mode, using HTML5.
It is also usually followed up by "html", meaning the document is using HTML5.
<!DOCTYPE html>
The <html> element is the second most important element within an HTML program,
as it must contain all other elements apart from <!DOCTYPE>.
The <html> element represents the root of an HTML document.
<html lang="en" dir="ltr">
</html>
The <html> element can also have a few attributes,
mainly used to help browsers identify the language and direction of the text within.
These are the most important attributes:
Commenting is an important feature within just about any programming language as it can be used to label and organize code.
Within HTML, a comment must be surrounded by "<!--" and "-->".
<!--This is what a comment would look like within a HTML document-->
The <head> element is one of two main elements which contain all other elements excluding <!DOCTYPE> and <html>.
The <head> element contains all metadata, code that doesn't directly affect what is viewed on the webpage.
<head>
<title>Webpage</title>
</head>
The <title> element is used to define a title for the webpage.
They are a necessary element within an HTML document, however, there can only be one <title> element within a file.
<title>Insert Title Here</title>
The <link> element is used to link to external resources.
The <link> element is completely empty, only using attributes.
<link rel="icon" type="image/png" href="D:\Coding Files\HTML Files\personalHTMLDemoIcon.png">
The <link> element has several different types of attributes, those being:
The <meta> element is used to define metadata of the page.
This includes keywords, author, and other important information.
<meta name="author" content="Rebytre">
The <meta> element has several important attributes, being:
The <style> element is used for adding small style sheets to pages without the use of external files.
This element usually gets overshadowed by external CSS files, however it is still useful for smaller websites or testing without the need to manage files.
<style>
#spanDemoE1{
color:#ff0000
}
#spanDemoE2{
color:#0000ff
}
</style>
The <script> element is used to add JavaScript to a program.
It is recommended to put it inside the <head> container as it keeps the code more organized and it is the better option for larger websites.
Do note however that it is also possible to use it outside of the <head> element. This is the better option for smaller websites.
<script src="#" defer></script>
These are the attributes that <script> can contain while inside a <script> container (async/defer are necessary for optimization):
The <noscript> element is used as a fallback in case JavaScript is disabled/not supported in the browser.
Any text within the element is displayed if JavaScript is not available.
<noscript>
<p>Your browser does not support JS.</p>
</noscript>
The function <nav> specifies to the browser which links are used for site navigation.
The <nav> element only contains links that act as navigation for the site.
Its main goal is to assist with accessibility and helping search engines understand how the website is structured.
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
This element does not produce a visible product/change, so no outcome will be included.
The <header> element usually contains all introductory content or navigational links.
This can mean images, text, links, and author information.
You cannot place a <header> element inside an <address>, <footer>, or another <header> element.
<header>
<h1>Title</h1>
<address>
John Doe
john@example.com
123 Street, City
</address>
</header>
This element does not produce a visible product/change, so no outcome will be included.
The <main> element usually contains all of the main content of a webpage.
There should only be one <main> element per page.
It also should not be placed inside <article>, <aside>, <footer>, <header>, or <nav> elements.
<main>
<p>
This is a paragraph.
</p>
<p>
This is another paragraph.
</p>
</main>
This element does not produce a visible product/change, so no outcome will be included.
The <section> element signifies a section inside a document.
The main difference between <section> and <div> is that <section> can be viewed by browsers,
as in they will recognize that whatever is inside of <section> is a standalone section,
while <div> has no semantic meaning on its own,
so its contents aren't treated as a distinct section unless styled or given certain attributes.
<section>
<h1>Title</h1>
<p>Paragraph 1</p>
</section>
This element does not produce a visible product/change, so no outcome will be included.
The <article> element is similar to <section>,
except, it is intended for content that can stand alone independantly.
The element can feature content such as blog posts, user comments, or magazine articles.
<article>
<h1>Title</h1>
<p>Standalone Paragraph</p>
</article>
This element does not produce a visible product/change, so no outcome will be included.
The <aside> element is used for containing additional information.
The <aside> element can be used for author bios, related links/articles, notes, sidebars, or tips.
<aside>
<p>
You might also like:
</p>
<a href="#">Link</a>
</aside>
This element does not produce a visible product/change, so no outcome will be included.
The <address> element is used to define an author's or owner's contact information.
Contact information can be information such as an email address, phone number, address, URL, and more.
<address>
John Doe
john@example.com
123 Street, City
</address>
The <footer> element is found at the bottom of a section/page.
It typically includes information about the author, copyright rules, contact info, and related links.
Any contact info inside the <footer> is typically put into an <address> element.
<footer>
<p>
Copyright info here:
</p>
<address>
Written by: Rebytre
rebytre101@gmail.com
</address>
</footer>
This element does not produce a visible product/change, so no outcome will be included.
The <span> element acts as a group, with anything inside of it being a part of that group.
It is useful for affecting multiple elements at once.
Unlike <div>, <span> is an inline element,
meaning it doesn't create new indentations around it.
This is useful for applying styles to certain sections of text without creating unnecessary indentation.
<p>
This word is <span id="spanDemoE1">Red</span>.
This word is <span id="spanDemoE2">Blue</span>.
</p>
This word is Red.
This word is Blue.
The <div> element acts as a group, with anything inside of it being a part of that group.
It is useful for affecting multiple elements at once.
Unlike <span>, <div> is a block-level element,
meaning it creates indentations before and after itself.
This is usually used for dividing code into multiple easier-to-manage sections.
Make sure not to add <div> elements into inline elements (ie. <a>, <span>, etc).
<div id="divDemoE1"><p>This text is red. </p></div>
<div id="divDemoE2"><p>This text is blue. </p></div>
NOTE: Indentation on top
This text is red.
This text is blue.
NOTE: Will also be indented below
Probably the most basic of all HTML elements,
the <h𝔁> function produces a heading. Depending on the number "𝔁" (must be between 1 and 6),
it produces a header. The lower "𝔁" is as a number, the bigger the heading.
Below are examples of each header size, descending from greatest to smallest:
<h1>Heading No.1 </h1>
<h2>Heading No.2 </h2>
<h3>Heading No.3 </h3>
<h4>Heading No.4 </h4>
<h5>Heading No.5 </h5>
<h6>Heading No.6 </h6>
The <p> element is the main way of printing out text.
It doesn't follow spacing within the code, unlike <pre>.
This very paragraph is an example of <p>.
<p>
The <p> element is the main way of printing out text.
It doesn't follow spacing within the code, unlike <pre>.
This block of text itself is an example of the <p> element.
</p>
Outcome can be found above the code.
The element <br> can be put almost anywhere and creates a line break in the program.
It doesn't have a closing tag.
It functions similarly to a newline character (\n) in languages such as Python.
<p>
This paragraph will be<br><br> split in half.
</p>
This paragraph will be
split in half.
The <hr> element creates a horizontal line across the page to indicate a new part of the website.
It is an empty element and does not require a closing tag.
<hr>
<hr>
<hr>
The <blockquote> element is used to indicate that a section of text is quoted from an external source.
It must include a "cite" attribute, followed by a link to the source the text is quoted from.
<blockquote cite="www.google.com">
This text is from a different source.
</blockquote>
This text is from a different source.
The <code> element is used to define whatever text is inside the element as being computer code.
<p>The <code>code</code> element is used to define code.</p>
The code
element is used to define code.
The <pre> element is used to write pre-formatted text within a page.
It preserves all spaces and line breaks, and typically uses a thinner/monospace font.
<pre>Test te xt.</pre>
Test te xt.
The element <ul> creates an unordered list,
meaning the items are not numbered, but instead use bullet points.
As with all lists, they can be nested into each other.
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
The <menu> element is used to define an unordered list of content.
It is mainly used for interactive menus or context menus.
<menu>
<li>Command 1</li>
<li>Command 2</li>
<li>Command 3</li>
</menu>
The element <ol> creates an ordered list, meaning it is numbered.
As with all list, they can be nested.
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
Unlike other types of lists,
ordered lists have 3 special attributes that can be applied to them.
The first is the "start" attribute, which can change the starting number of the list.
<ol start="2">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
The second is "reversed", which makes the list count downwards.
<ol reversed>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
The third is the "type" attribute, which changes the marker style.
<ol type="1">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<ol type="a">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<ol type="A">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<ol type="i">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
<ol type="I">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
The element <li> is used in creating items on a list.
It is placed within a larger list element, such as <ul> or <ol>.
It cannot be added into a <dl> list.
Anything inside an <li> becomes a list item.
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
The element <dl> creates a list where each item has a description.
Unlike <ol> and <ul>, description lists use a different structure with <dt> and <dd> instead of <li>.
<dl>
<dt>Item 1</dt>
<dd>Description 1</dd>
<dt>Item 2</dt>
<dd>Description 2</dd>
<dt>Item 3</dt>
<dd>Description 3</dd>
</dl>
The element <dt> is similar to the element <li>,
except specifically for a description list.
However, <dt> acts as the term or label being described.
<dl>
<dt>Item 1</dt>
<dd>Description 1</dd>
<dt>Item 2</dt>
<dd>Description 2</dd>
<dt>Item 3</dt>
<dd>Description 3</dd>
</dl>
The element <dd> creates a description in the list.
It is always paired with a <dt> element.
<dl>
<dt>Item 1</dt>
<dd>Description 1</dd>
<dt>Item 2</dt>
<dd>Description 2</dd>
<dt>Item 3</dt>
<dd>Description 3</dd>
</dl>
The <img> element creates a holding space for an image to be inserted.
The <img> has no end tag.
The <img> has 2 necessary attributes, those being "src" and "alt".
Specifying width and height helps browsers reserve space for the image and improves preformance.
<img alt = "HTML5" src = "https://upload.wikimedia.org/wikipedia/commons/thumb/6/61/HTML5_logo_and_wordmark.svg/800px-HTML5_logo_and_wordmark.svg.png" width = "200px" height = "200px">
The <source> element is used to specify multiple media resources for any type of media.
By using the media attribute with CSS media queries, you can change the media being displayed based on the viewport.
<source srcset="image.svg" media="#" type="image/svg">
By itself, <source> does not produce a visible result, and as such no output will be shown. See below for an example involving <source>.
The <source> always must have attributes. Here is a ul of them:
The <picture> element is essentially a more adaptable version of <img>,
being able to render different images (or different variants of the same image) depending on the viewport size or device capabilities.
<picture>
<source srcset="image.svg" media="#" type="image/svg">
<source srcset="image.png" media="#" type="image/png">
<img alt="Nature Photo" src="test img">
</picture>
The <audio> element is used to add audio content into a document.
<source> elements are used inside of <audio>,
however text may also be added after as a fallback measure in case the audio files don't work.
<audio>
<source src="###.mp3" type="audio/mp3">
<source src="###.mp3" type="audio/mp3">
Audio failed.
</audio>
The <audio> element also includes a few attributes that can be used to alter how the audio file is played. They are:
The <video> element is used to embed a video into a page.
<video> typically includes one or more <video> elements along with text as an error message.
<video>
<source src="###.mp4">
<source src="###.mp4">
Video failed.
</video>
The <video> element also has a few attributes that can be used to alter how the element functions. They are:
The <track> element is used to add text tracks (subtitles) for <audio> or <video> elements.
Tracks are formatted in WebVTT format (.vtt files).
<video>
<source src="###.mp4">
<source src="###.mp4">
<track src="###.vtt" kind="subtitles" scarlang="en" label="English">
Video failed.
</video>
I unfortunately don't have a subtitle file so... sorry!
The <track> element also has a few possible attributes. They are:
The <figure> element is used to define media with a caption.
A <figure> element can work without <figcaption>, but including one provides context.
<figure>
<img src="#" type="image/jpg">
<figcaption>The photo above is really cool.</figcaption>
</figure>
The <figcaption> element defines a caption for any piece of media within a <figure> element.
It absolutely must be used inside a <figure> element.
<figure>
<img src="#" alt="text">
<figcaption>The photo above is really cool.</figcaption>
</figure>
This element must be used within another to work. See next section for an example.
The <a> element defines a hyperlink,
which is used to link one page, rescource, or location to another.
<a href="https://www.w3schools.com/tags/tag_a.asp"> Element</a>
Links have a total of nine different attributes that can be added onto them. This excludes the "style" attribute that can be applied onto just about every element.
The "download" attribute specifies to the browser to download the target rather than attempting to open it.
It can be found in two forms.
The first form is an empty attribute, telling the browser to download the item.
The second form instead has a string value,
telling the browser to save the file with the custome name provided (the string inside "download").
<a href="###.pdf" download>Download</a>
or:
<a href="###.pdf" download="Custom_File">Download</a>
The "href" attribute is the only necessary attribute of the <a> element.
The "href" attribute specifies the url/path that the link should go to.
You can also use href="#top" or href="#" to link to the top of the current page.
There are also two values that can be used in an "href" attribute, those being "mailto:[email]" (navigates to email) and "tel:[number]" (navigates to phone number).
<a href="url/path">Link</a>
The "hreflang" attribute specifies the language of the page the href url links to.
It is only used if the href attribute is set.
<a href="#" hreflang="language abbreviation (ex: "en", "fr", etc.)">Link</a>
The "media" attribute is used to specify the media/device the linked document is optimized for, using the same syntax as CSS media queries.
<a href="#" media="value">Link</a>
The "ping" attribute can send a short message to a specified URL whenever a user clicks the link.
This attribute is useful for tracking/monitoring.
<a href="#" ping="link">Link</a>
The "referrerpolicy" attribute limits how much information the URL within the link is allowed to receive from the user.
This is useful for security, performance, and compliance reasons.
There are a couple different possible values for the attribute.
They are:
<a href="#" referrerpolicy = "value">Link</a>
The "rel" attribute lets the browser know the relationship between the link and the site.
Here are its possible values:
<a href="#" rel="value">Link</a>
Specifies how to open the linked url.
There are five possible values:
<a href="#" target="value">Link</a>
Specifies the MIME type of the url.
A list of possible values can be found here.
Specifies a keyboard shortcut to access a link.
<a href="#" accesskey="l">Link</a>
While the <nav> element may have already been explained in 3A,
it is important to note <nav>'s importance in navigation through links.
It is common to find the <nav> element containing links used for navigation.
See 3A for information about <nav>.
The <form> element is used to create an HTML form designed to collect user input.
It can contain one or more form elements.
Placeholder text... (I'm not making an entire form for this right now, sorry!)
The <form> element can have a few attributes that come with it, those being:
The <label> element is used to provide a label for certain elements.
This is useful for screenreaders and for identifying certain elements.
<label for="testMeter">This is a label for the meter</label>
<meter id="testMeter" min="0" low="3" optimum="5" high="7" max="10" value="2">2 out of 10</meter>
The <label> element only has one possible attribute, the "for" attribute.
It is used to provide the id of an element that it should affect.
This attribute is highly recommended.
The <button> element is used to create a clickable button.
It is generally better to use <button> rather than creating a button using <input>.
<button type="button">Click Me!</button>
The <button> element also has a few possible attributes. They are:
The <select> element is used to create dropdown menus.
It is most often used in forms.
<select>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
The <select> element also contains a few potential attributes. They are:
The <option> element is used within <select> elements,
to specify an option for the list.
<select>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
The <option> element also contains a list of attributes.
They are as follows:
The <input> element is used to create a single-line input field.
It is the most important form element.
<input type="text" placeholder="type here">
The <input> has a multitude of different attributes that can be attached to the element.
They are:
Similar to <input>, <textarea> is exactly the same except it allows for multi-line text input.
It is useful for whenever a user needs to submit a larger amount of text information.
<textarea>This is a <textarea>.</textarea>
Here are the potential attributes and their values for the <textarea> element:
The <fieldset> element is used to add a border around a form.
<fieldset>
<select>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
</fieldset>
The <fieldset> element has a few attributes that can be used.
They are:
The <legend> element provides a title that can be found within the <fieldset> element.
<fieldset>
<legend>Legend:</legend>
<select>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
</fieldset>
The <caption> element is used to add a caption to a table.
It must be inserted immediately after the <table> opening tag.
<table>
<caption>This is a caption</caption>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
Header 1 | Header 2 |
---|---|
Item 1 | Item 2 |
The <colgroup> element is a container for all <col> elements.
It must be within a <table> element, after the caption and before any table data.
<table>
<colgroup>
<col span="2" style="background-color:#ff0000">
</colgroup>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
Header 1 | Header 2 |
---|---|
Item 1 | Item 2 |
The <col> element is used to specify column properties for each column within a <colgroup> element.
They must ALWAYS be within the <colgroup> element.
The only non-CSS attribute that can be applied to <col> (minus the universal attributes) is "span", indicating how many columns this should affect.
Please note that only certain CSS properties (such as width, background, or border).
<table>
<colgroup>
<col span="2" style="background-color:#ff0000">
</colgroup>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
Header 1 | Header 2 |
---|---|
Item 1 | Item 2 |
The <table> element is used to create a table,
and is used as a container for all other table related elements.
<table>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
Header 1 | Header 2 |
---|---|
Item 1 | Item 2 |
The <thead> element defines the head section of the table.
This does not include <caption> or <colgroup>.
The element includes all headers.
<table>
<thead>
<tr><th>Header 1</th><th>Header 2</th></tr>
</thead>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
No visible changes occur, so no output will be shown.
The <tbody> element defines the body section of the table.
This includes all table values (apart from footers).
<table>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tbody>
<tr><td>Item 1</td><td>Item 2</td></tr>
</tbody>
</table>
No visible changes occur, so no output will be shown.
The <tfoot> element defines the footer section of the table.
This contains rows that summarize or provide footer information for the table.
<table>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
<tfoot>
<tr><td>Footer Item 1</td><td>Footer Item 2</td></tr>
</tfoot>
</table>
No visible changes occur, so no output will be shown.
The <tr> element is used as a container for <th> or <td> elements.
It is used to identify a table row.
<table>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
Header 1 | Header 2 |
---|---|
Item 1 | Item 2 |
The <th> element is used to define a header cell in a table.
Any text within will be automatically centered and bolded.
<table>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
Header 1 | Header 2 |
---|---|
Item 1 | Item 2 |
The <th> element can also have a few attributes:
The <td> element defines a data cell inside a table.
<table>
<tr><th>Header 1</th><th>Header 2</th></tr>
<tr><td>Item 1</td><td>Item 2</td></tr>
</table>
Header 1 | Header 2 |
---|---|
Item 1 | Item 2 |
The <td> element can also have a few attributes:
The <canvas> element is used whenever a canvas is used in the site.
The <canvas> creates a blank canvas, however JS is needed to draw inside of it.
It acts as a container for the graphics, and any text within is displayed in case the canvas isn't available/doesn't work.
To specify, JavaScript is used to draw graphics on the canvas by targeting it via it's id or another selector.
The JavaScript must always be OUTSIDE of the <canvas> element otherwise it becomes text.
<canvas id="Canvas1">
This canvas failed to load.
</canvas>
(Insert JS here)
(Insert JS here)
The <details> element is used to add dropdown details that can show and hide on demand.
This element must be used with the <summary> element (see below).
<details>
<summary>Test Dropdown</summary>
<p>Hey, it works! This is only a paragraph, but we can also add other elements such as lists.</p>
</details>
Hey, it works! This is only a paragraph, but we can also add other elements such as lists.
The <details> element only has two attributes, being "open", meaning the dropdown is open by default, and "closed", providing the opposite effect to "open".
The <summary> element is used to provide a heading for a dropdown created by a <details> element.
It always must be included within a <details> element, and always must be the first child.
The <summary> element can be clicked, triggering the <details> element to pop up.
<details>
<summary>Test Dropdown</summary>
<p>Hey, it works!</p>
</details>
This element must be used within another element to produce a change.
Please see above for an example involving <summary>.
The <dialog> element creates a dialogue box.
This is used for notifications, popups, and other similar applications.
Note to self - When programming, use DIALOG and not DIALOGUE!
<dialog open>
This is a dialogue window.
</dialog>
The <dialog> element only has a few HTML attributes, being "open" and "close". An "open" attribute is necessary to see the dialogue box if JavaScript isn't being used (like in this case). "close" does the opposite.
The <iframe> element adds the possibility of adding another document within your own.
This is useful for adding external content, such as embedding a Youtube video.
<iframe src="https://rebytre.github.io/HTML-Basics/" width="70%" height="250"></iframe>
The <iframe> element also features a few different attributes. They are:
The <label> element is used to provide a label for several other elements.
It is proper to use <label> whenever possible.
Coming soon!
Coming soon!
The <label> element has two attributes. They are:
The <meter> element is used to show a scalar measurement within a specified range.
It shouldn't be used to show progress, that must be shown through the <progress> element.
Any text within the <meter> element is used for accessibility.
Always remember to add a <label>!
<label for="testMeter1">Test Meter</label>
<meter id="testMeter1" min="0" max="10" optimum="5" value="7">7 out of 10</meter>
The <meter> element also features a few different attributes. They are:
The <progress> element is used to create a progress bar.
Any text within the <progress> element is used for accessibility.
Don't forget to add a label.
<label for="testProgressBar1>Test Progress Bar</label>
<progress id="testProgressBar1" max="100" value="54">54%</progress>
The <progress> element has two attributes. They are:
The <output> element is used to represent the result of a calculation (preformed by a script).
Coming soon!
Coming soon!
The <output> element has three attributes. They are:
The <template> element is used to contain HTML content and hide it.
It can only be used if JavaScript is applied.
<template>
<p>This text is hidden.</p>
</template>
To have a visible output, this text needs JavaScript, which I am unfortunately not too familiar with as of yet. Until I update this, enjoy this image of a frog ;b
The element <abbr> lets the browser know that the text within is an abbreviation.
This can also be used to let users know what the abbreviation means by including a "title" attribute within the element.
When the user hovers over the text, the full unabbreviated version will be displayed.
In general, it should be used on abbreviations, acronyms, and other similar cases.
<p>
I really don't like people who say <abbr title="Laugh Out Loud">LOL</abbr>.
</p>
I really don't like people who say LOL.
The <address> element is used to define that the text within is important contact information.
Most browsers render this text in italic, however this is not always the case.
It does not follow indentation.
<address>
Written by: Rebytre
rebytre101@gmail.com
</address>
The <b> element is used to bold any text within.
According to HTML5 specification, it should only be used for text with no semantic meaning. Whenever applicable, always try using
other elements such as <h𝔁>, <em>, <strong>, and <mark>.
<p>
This text is <b>BOLD</b>.
</p>
This text is BOLD.
The element <em> is used to emphasize text.
It makes any text within display italicized.
<p>This is <em>so</em> boring.</p>
This is so boring.
The element <i> is used to italicize text.
It should be considered as a last resort if any other semantic text doesn't fit the use.
<p>And then he said <i>Bonjour!</i>, what could that mean...</p>
And then he said "Bonjour!", what could that mean...
The element <mark> highlights text and defines it as valuable.
<p>Don't forget the <mark>cookies</mark>!</p>
Don't forget the cookies!
The element <strong> is used to define text that is important.
Any content inside is displayed in bold.
<p>Remember to use <strong>common sense</strong> always!</p>
Remember to use common sense, always!