Introduction Toweb Development & HTML (Cs220)
Introduction Toweb Development & HTML (Cs220)
Introduction Toweb Development & HTML (Cs220)
TBS/2019-2020
Internet VS Web
2
Response format
The HTTP protocol (3/3)
8
bold
Result A Review of the Book Wind Instruments Century
HTML versions
11
HTML 1: 1991 HTML 4: 1998
Proposes
Version 1
the use of frames, of
Created by Tim Berners- complex tables,
Improvements on the
Lee in.
forms, etc.
HTML 2: 1994 First use of style sheets,
Laid the basis of the CSS.
following versions of HTML 5: 2014
HTML. Current version.
HTML 3: 1 9 9 6 More improvements such as
the ability to easily include
Added new structures videos,
such as tables, applets, a better layout of content,
scripts, text positioning new features for forms, etc.
Computer browsers
Google Chrome, Mozilla Firefox, Internet Explorer (up
to windows 10), Edge, Safari, Opera, etc.
Mobile browsers
Lighter versions of computer browsers to suit the mobile
limitations
Step 1:
<body>
<h1> This is heading. </h1>
<p> Document description goes here. </p>
</body>
</html>
HTML Tutorial(3/3)
17
Step4:
Open Xampp Control panel
Start Apache (you must have a green background).
Step 5:
Open your browser (chrome for example)
Type this url :
localhost/YourFirstNameLastSurnameGroupSite.
HTML tags
18
HTML Tags definition
19
<tagname> content</tagname>
DOCTYPE:
o MUST be the very first line of your file, before <html>.
o NOT an HTML tag; it is an instruction to your web browser.
o Tells the browser what version of HTML to expect (version 5 here).
HTML Page Structure (2/3)
21
Empty elements
HTML elements with no content
do not have an end tag
Example: <br> element (for a line break).
o Title,
o Body,
o Headings,
o Paragraphs,
o Links,
o Lines,
o Images,
o Lists,
o Tables,
o Frames,
o Forms,
o …
HTML Title
23
<title> content</title>
Example
<html>
<head>
<title> This is my first web page </title>
</head>
<body>
</body>
</html>
HTML body
24
Example
<html>
<head>
<title> This is my first web page </title>
</head>
<body>
<p> Page Content</p>
</body>
</html>
HTML Headings
25
Example
<html>
<head>
<title> This is my first web page </title>
</head>
<body>
<h1> This is first level heading </h1>
<h2> This is second level heading </h2>
<h3> This is third level heading </h3>
</body>
</html>
HTML paragraphs
26
Example
<html>
<head>
<title> This is my first web page </title>
</head>
<body>
<p> paragraph1</p>
<p> paragraph2</p>
</body>
</html>
HTML Text formatting (1/2)
27
Formatting tags: HTML tags like <b> (bold ) and <i> (italic ) to
format output Tag Description
<b> Defines bold text
<strong> Defines strong text
<i> Defines italic text
<em> Defines emphasized text
<small> Defines small text
<sub> Defines subscripted text
<sup> Defines superscripted text
<ins> Defines inserted text
<del> Defines deleted text
<mark> Defines marked/highlighted text
HTML Text formatting (2/2)
28
Example
<html>
<head>
<title> This is my first web page </title>
</head>
<body>
<p> The following word uses a <b> bold </b> typeface. </p>
<p> The following word uses a <i> italicized </i> typeface. </p>
<p> The following word uses a <sup> superscript </sup> typeface. </p>
<p> The following word uses a <sub> subscript </sub> typeface. </p>
<p> The following word uses a <small> small </small> typeface. </p>
</body>
</html>
HTML PRE Text formatting
29
When you move the cursor over the link, the arrow will turn into a little hand.
<a> can be used to create a link to another document, by using the href attribute.
The "Link text" doesn't have to be text. It can be an image or any other HTML
element.
<body>
<a href="http://www.utunis.rnu.tn/tbs/">Tunis Business School</a>
</body>
The <hr>tag
Creates a horizontal line in an HTML page.
Used to separate content.
<body>
<p> This is a paragraph </p>
<hr> </hr>
<p> This is another paragraph </p>
<hr> </hr>
<p> This is a third paragraph </p>
</body>
You can also add a brief description of the image using the ‘alt’
attribute.
It tells the reader what is missing on the webpage if the
browser can't load images.
The browser will then display the alternate text instead of the
image.
<img src=“dog.jpg” width=“120” height=“100” alt=My pet dog”>
HTML Images Map
33
Use the <map> tag to define an image-map: an image with clickable areas.
The name attribute of the <map> tag is associated with the <img>'s usemap
attribute and creates a relationship between the image and the map.
The <map> tag contains a number of <area> tags, which define the
clickable areas in the image-map:
HTML Lists
34
Each row is divided into data cells (with the <td> tag).
o A <td> tag can contain text, links, images, lists, forms, other
tables, etc.
Header information in a table is defined with the <th> tag.
Example
<body>
<table style="width:100%">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
</tr>
<tr>
<td>Jill</td>
<td>Smith</td>
<td>50</td>
</tr>
</table>
</body>
HTML iFrames (1/2)
37
The <iframe> tag defines a rectangular region within the document in which
the browser can display a separate document, including scrollbars and
borders.
Click the Link icon (share) in the panel to the left of the map.
The controls attribute adds video controls, like play, pause, and volume.
There are 3 supported video formats: MP4, WebM, and Ogg. (only MP4
is supported by all the browsers)
HTML Audio Element
40
Forms are the most popular way to make web pages interactive. A form on a
web page allows the user to enter requested information and submit it for
processing.
An HTML form can contain input elements like text fields, checkboxes, radio-
buttons, submit buttons and more. A form can also contain select lists,
textarea, fieldset, legend, and label elements.
<input type="text"> defines a one-line input field that a user can enter text
into:
<body>
<form>
First name:<br>
<input type="text" name="firstname">
<br>
Last name:<br>
<input type="text" name="lastname">
</form>
</body>
<input type="radio"> defines a radio button. Radio buttons let a user select
ONLY ONE of a limited number of choices.
HTML Forms: Text Fields (2/2)
43
<body>
<form>
<input type="radio" name="gender" value= "male" checked> Male<br>
<input type="radio" name= "gender" value= "female"> Female<br>
The <select> element is used to create a drop-down list. The <option> tags
inside the <select> element define the available options in the list.
<body>
<form>
<select name= "car category" >
<option value= "volvo" >Volvo</option>
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</select>
</form>
</body>
HTML Forms: Button
45
There are various ways in HTML to create clickable buttons. You can create clickable
button using <input> tag.
When you use the <input> element to create a button, the type of button you create is
specified using the type attribute. The type attribute can take the following values:
<form action="action_page.php">
First name:<input type="text" name="firstname"><br>
Last name:<input type="text" name="lastname"> <br>
<input type="submit" value= "Submit" >
<input type="reset" value= "Reset">
</form>
HTML5 Content Elements
46
HTML5 offers new semantic elements to define different parts of a web page: