Async Await in JavaScript
Understand how to use async/await in JavaScript to handle asynchronous calls more effectively and improve code readability.
September 6th, 2024
By: Ismail M. BOUSSEKINE and MALEK Fatma Zohra
HTML (HyperText Markup Language) is the standard language used to create and structure content on the web. It is a markup language that uses a system of tags to define elements and their relationships within a document. HTML provides the structure of a web page, including headings, paragraphs, links, images, tables, and more.
When you visit a website, the browser requests the HTML file from the server and renders the content on the screen. The browser reads the HTML file from top to bottom and displays the content according to the structure defined by the HTML tags. The browser also loads and executes any CSS and JavaScript files linked to the HTML document to style the content and add interactivity.
To get started with HTML, you need a text editor and a web browser. You can write HTML code in any text editor, such as Visual Studio Code (what we will be using in our course), and save the file with a .html extension. You can then open the HTML file in a web browser to see the rendered output using Live Server extnesion in VS Code.
Lets Our first HTML document:
<!DOCTYPE html>
is the document type declaration that specifies the version of HTML being used.<html>
is the root element of an HTML page, and all other elements are contained within it.<head>
contains meta-information about the document, such as the title of the page.<body>
contains the content of the document, such as headings, paragraphs, images, and links.An HTML tag is a keyword surrounded by angle brackets, like <html>
. HTML tags are used to define the structure of an HTML
document and are usually paired with an opening tag and a closing tag. Some tags, like <img>
, are self-closing and do not
require a closing tag. Tags can also have attributes that provide additional information about the element, such as the
src
attribute in an <img>
tag.
Example:
<!DOCTYPE html>
declaration defines the document type and version of HTML being used.<html>
element is the root element of an HTML page.<head>
element contains meta-information about the document, such as the title and links to CSS and JavaScript files.<meta>
element provides metadata about the HTML document, such as the character set and viewport settings.<title>
element specifies the title of the document, which is displayed in the browser tab.<body>
element contains the content of the document, such as headings, paragraphs, images, and links.<!-- Comment -->
is used to add comments to the HTML code that are not displayed in the browser.<h1>
is the largest heading size, and <h6>
is the smallest heading size.
Always remeber thats <h1>
is the most important heading (the bigger by default)
and <h6>
is the least important (the smaller by default).
Let's see how it looks in the browser.
<p>
tag is used to define a paragraph.
Try it out !
<span>
tag is used to define a section in an HTML document.
<b></b>
and <strong></strong>
tags are used to make text bold.
<i></i>
and <em></em>
tags are used to make text italic.
example :
Try it out !
<ul>
and <ol>
tags are used to define unordered and ordered lists, respectively.
<br>
tag is used to insert a line break in a paragraph.
<wbr>
tag is used to insert a line break in text.
<hr>
tag is used to insert a horizontal rule (line) in the document.
<a>
tag is used to create hyperlinks to other web pages, files, locations within the same page, email addresses, and more.
There is a diffrence between absolute and relative URLs, an absolute URL is the full URL to a page, including the protocol (http:// or https://), domain (www.example.com), and path (/page). A relative URL is a URL that is relative to the current page, such as a link to another page on the same website.
<img>
tag is used to embed images in an HTML document.
The src
attribute specifies the URL of the image, and the alt
attribute provides alternative text for the image, which is displayed if the image cannot be loaded.
<table>
tag is used to create tables in an HTML document.
tr
tag is used to define a row in the table, th
tag is used to define a header cell in the table, and td
tag is used to define a data cell in the table.
<select>
tag is used to create a dropdown list in an HTML form.
HTML attributes provide additional information about HTML elements and are always specified in the opening tag.
Most used Attributes are id
, class
, style
, src
, href
, alt
, width
, height
, title
, target
, name
, value
, type
, placeholder
, required
, disabled
, checked
, selected
, multiple
id
attribute is used to uniquely identify an element within a document.class
attribute is used to define multiple elements with a common style or behavior.style
attribute is used to define inline CSS styles for an element.src
attribute is used to specify the URL of an image or media file.href
attribute is used to specify the URL of a link.alt
attribute is used to provide alternative text for an image.width
and height
attributes are used to specify the dimensions of an image.title
attribute is used to provide additional information about an element.target
attribute is used to specify where to open the linked document. like _blank
to open in a new tab.name
attribute is used to specify the name of an element, such as a form input.value
attribute is used to specify the value of an element, such as a form input.type
attribute is used to specify the type of an element, such as a form input. like text
, password
, submit
, radio
, checkbox
, file
, button
, reset
, email
, number
.placeholder
attribute is used to specify a short hint that describes the expected value of an input field.required
attribute is used to specify that an input field must be filled out before submitting a form.disabled
attribute is used to specify that an input field should be disabled.checked
attribute is used to specify that a checkbox or radio button should be checked by default.selected
attribute is used to specify that an option in a dropdown list should be selected by default.multiple
attribute is used to specify that multiple options can be selected in a dropdown list.autocomplete
attribute is used to specify whether an input field should have autocomplete enabled or disabled.
And more...<audio>
tag is used to embed audio content in an HTML document.
The controls
attribute adds audio controls, such as play, pause, and volume, to the audio player.
<video>
tag is used to embed video content in an HTML document.
The controls
attribute adds video controls, such as play, pause, and volume, to the video player.
<input>
tag is used to create an input field in an HTML form.
<label>
tag is used to define a label for an <input>
element.
The for
attribute in the <label>
tag specifies which input field the label is associated with by matching the id
attribute of the input field.
<button>
tag is used to create a clickable button in an HTML form.
The type
attribute specifies the type of button, such as submit
, reset
, or button
.
<form>
tag is used to create an HTML form for user input.
The action
attribute specifies the URL where the form data should be submitted, and the method
attribute
specifies the HTTP method to use, such as get
or post
.
<div>
tag is used to define a division or section in an HTML document.
<div>
tag is a generic container that can be used to group elements together and apply styles or behavior to them.
Semantic HTML elements are those that clearly describe their meaning in a human-readable way. thy are just div
with a meaning.
Some of the most common semantic HTML elements are:
<header>
: Defines a header for a document or section.<nav>
: Defines a navigation menu.<main>
: Defines the main content of a document.<section>
: Defines a section in a document.<article>
: Defines an article in a document.<aside>
: Defines content aside from the content it is placed in.<footer>
: Defines a footer for a document or section.<figure>
: Defines self-contained content, such as images or diagrams.<figcaption>
: Defines a caption for a <figure>
element.<time>
: Defines a date or time.Exmple of a semantic HTML webpage:
Assignment: Create a Simple Personal Web Page
Remark: Remamber to use all the tags we have learned in the workshop to get a comprehensive understanding of HTML.
In this workshop, we learned the basics of HTML and how to create a simple webpage using HTML elements and tags. We covered the structure of an HTML document, text formatting, links, images, tables, forms, and more. We also discussed the importance of semantic HTML elements and how they can improve the accessibility and SEO of a webpage. We hope you found this workshop helpful and that you are now ready to create your own web pages using HTML. Wait for the next workshop to learn more about CSS and how to style your web pages. Stay tuned!.
Understand how to use async/await in JavaScript to handle asynchronous calls more effectively and improve code readability.
September 6th, 2024
This article will guide you on how to choose your linux distribution based on your needs and use case, It will also provide a list of the best linux distributions out there.
September 13th, 2024
Learn about integrals in calculus with detailed explanations and examples using LaTeX mathematical notation.
September 5th, 2024