02 HTML
02 HTML
25 février 2024
Lecturer
Dr. HAMDANI M
6 <a> element
6 <a> element
Introduction
Most people use the two terms interchangeably but they are in fact
different.
The Internet is a vast, international network, made up of com-
puters and the physical connections (wires, routers, etc.) allowing
them to communicate.
The World Wide Web (WWW or just the Web) is a collection
of software that spans the Internet and enables the interlinking of
documents and resources.
Fixed Content
HTML, CSS, and Limited JavaScript
Manual Updates
Limited Interactivity
Examples : Personal Blogs, Brochure Sites
Dynamic Content
Server-Side Scripting (PHP, Python, etc.)
Easy Updates (Content Management Systems)
High Interactivity (User Logins, E-commerce)
Examples : Social Media, E-commerce, Web Applications
6 <a> element
What is HTML ?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>
Best Practice
The text in your TITLE should be as descriptive as possible
because this is what many search engines, on the internet, use
for indexing your site.
6 <a> element
Semantic Markup
6 <a> element
New Semantic Elements
New form types for improved user input : email, date, time, url,
search, etc.
New attributes like placeholder, autocomplete, required, and pat-
tern for better form validation and user experience.
6 <a> element
Headings
<body>
<h1>Main Heading</h1>
<p>This is some introductory content.</p>
<h2>Section 1</h2>
<p>Content for section 1 goes here.</p>
<h3>Subsection 1.1</h3>
<p>Content for subsection 1.1 goes here.</p>
<h2>Section 2</h2>
<p>Content for section 2 goes here.</p>
</body>
Styling for Appearance : Applying heading tags solely for styling (e.g.,
making text larger) rather than for semantic meaning.
Using Headings for Links : Assigning headings to links (e.g., <a> with
<h2>), which can disrupt the page’s structure.
Text Generator
1 Microsoft Word :
=rand(), or
=lorem(4,5) : for 4 paragraphs of 5 sentences
2 VSCode : loremNumber_of_words
Example : <p> lorem10 </p>
3 https://www.lipsum.com/
<p>
This is a paragraph of text.
It can contain multiple sentences and line breaks.
</p>
<p>
This is some text. <br> This text is on a new line.
</p>
<pre>
This is an example of preformatted text.
Here are some spaces: and some tabs: \t
This text will be displayed exactly as written,
including line breaks.
</pre>
<HR> attributes :
6 <a> element
a element
Is used to define hyperlinks, which allow users to jump from one loca-
tion to another
href : (Hypertext REFerence) : URL of the page the link goes to.
This attribute is what makes an <a> element a hyperlink.
link text : The clickable text that is displayed to the user.
Download Link :
<a href="/path/to/file" download="filename">Download
File</a>
Email Link :
<a href="mailto:[email protected]">Send Email</a>
6 <a> element
<img> tag
<ol>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ol>
Result
1. First item
2. Second item
3. Third item
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul>
Result
First item
Second item
Third item
6 <a> element
Table
6 <a> element
About FORMs
Forms are used to collect information from people viewing your
web site.
For example, you can use forms to find out details about your
visitors through surveys and feedback, or engage in e-commerce
by selling your goods and services to people.
Forms are defined by the <FORM> </FORM> tags and are
made up of different elements to collect data.
Once the user inputs all of the information, they submit the form
by using the "submit" button that you create.
What happens with the data is a decision you will need to make.
You can use a script to manage the data, sent the data to data-
base, or even receive data via e-mail.
The POST method does not display the submitted form data in
the page address field.
Used for sensitive or personal information.
Has no size limitations, and can be used to send large amounts
of data.
<form action="action_page.php">
<label for="birthdate">Birthdate:</label><br>
<input type="date" id="birthdate" name="birthdate"
required><br><br>
<label for="country">Country:</label><br>
<select id="country" name="country">
<option value="algeria">Algeria</option>
<option value="canada">Canada</option>
<option value="uk">UK</option>
</select><br><br>
<label for="bio">Bio:</label><br>
<textarea id="bio" name="bio" rows="4"
cols="50"></textarea><br><br>
6 <a> element
div
<div class="container">
<h2>This is a heading</h2>
<p>
This is some content wrapped in a `<div>` element with
the class "container".
</p>
</div>
6 <a> element
Article and Section
article :
Represents a self-contained, independent piece of content
Provides semantic meaning for both users and search engines
Improves accessibility by helping screen readers identify and an-
nounce distinct content units
section :
Defines a thematic section within a document
Used to organize and structure content within an article or larger
page
Offers a way to visually and semantically divide content for better
understanding
<header>
<h1>This is an Article Title</h1>
</header>
<section class="introduction">
<p>This is the introduction of the article, providing a brief
overview.</p>
</section>
<section class="main-body">
<h3>Headline 1</h3>
<p>This is the main content of the article, with detailed information and
explanations.</p>
<h3>Headline 2</h3>
<p>Here's another section with additional information related to the main
topic.</p>
</section>
<section class="conclusion">
<p>This is the conclusion of the article, summarizing the key points and
leaving a final thought.</p>
</section>
</article>