Unit 4 ICSE Imp Topics
Unit 4 ICSE Imp Topics
Introduction to HTML:
1. <!DOCTYPE>
2. <html>
3. <head>
4. <title>Web page title</title>
5. </head>
6. <body>
7. <h1>Write Your First Heading</h1>
8. <p>Write Your First Paragraph.</p>
9. </body>
10. </html>
What is HTML
HTML is an acronym which stands for Hyper Text Markup
Language which is used for creating web pages and web applications.
Let's see what is meant by Hypertext Markup Language, and Web page.
<html > :This tag informs the browser that it is an HTML document. Text
between html tag describes the web document. It is a container for all
other elements of HTML except <!DOCTYPE>
<head>: It should be the first element inside the <html> element, which
contains the metadata(information about the document). It must be
closed before the body tag opens.
<title>: As its name suggested, it is used to add title of that HTML page
which appears at the top of the browser window. It must be placed inside
the head tag and should close immediately. (Optional)
<body> : Text between body tag describes the body content of the page
that is visible to the end user. This tag contains the main content of the
HTML document.
<h1> : Text between <h1> tag describes the first level heading of the
webpage.
<p> : Text between <p> tag describes the paragraph of the webpage.
Html VERSION:
HTML 1.0: The first version of HTML was 1.0, which was the barebones
version of HTML language, and it was released in1991.
HTML 2.0: This was the next version which was released in 1995, and it
was standard language version for website design. HTML 2.0 was able to
support extra features such as form-based file upload, form elements such
as text box, option button, etc.
HTML 3.2: HTML 3.2 version was published by W3C in early 1997. This
version was capable of creating tables and providing support for extra
options for form elements. It can also support a web page with complex
mathematical equations. It became an official standard for any browser till
January 1997. Today it is practically supported by most of the browsers.
HTML 4.01: HTML 4.01 version was released on December 1999, and it is
a very stable version of HTML language. This version is the current official
standard, and it provides added support for stylesheets (CSS) and
scripting ability for various multimedia elements.
HTML5 : HTML5 is the newest version of HyperText Markup language.
The first draft of this version was announced in January 2008. There are
two major organizations one is W3C (World Wide Web Consortium), and
another one is WHATWG( Web Hypertext Application Technology Working
Group) which are involved in the development of HTML 5 version, and still,
it is under development.
Features of HTML
1) It is a very easy and simple language. It can be easily understood
and modified.
o Tags: An HTML tag surrounds the content and apply meaning to it. It is
written between < and > brackets.
o Attribute: An attribute in HTML provides extra information about the
element, and it is applied within the start tag. An HTML attribute contains
two fields: name & value.
Syntax
1. <tag name attribute_name= " attr_value"> content </ tag name>
Example:
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title>The basic building blocks of HTML</title>
5. </head>
6. <body>
7. <h2>The building blocks</h2>
8. <p>This is a paragraph tag</p>
9. <p style="color: red">The style is attribute of paragraph tag</
p>
10. </body>
11. </html>
Output:
HTML Tags
HTML tags are like keywords which defines that how web browser will
format and display the content. With the help of tags, a web browser can
distinguish between an HTML content and a simple content. HTML tags
contain three main parts: opening tag, content and closing tag. But some
HTML tags are unclosed tags.
o All HTML tags must enclosed within < > these brackets.
o Every tag in HTML perform different tasks.
o If you have used an open tag <tag>, then you must use a close tag
</tag> (except some tags)
Syntax
<tag> content </tag>
<br> Tag: br stands for break line, it breaks the line of the code.
<hr> Tag: hr stands for Horizontal Rule. This tag is used to -put a line
across the webpage.
Tags in HTML
There are many tags in HTML which facilitate the process of describing
web page to the server. These tags are arranged in a specific manner to
get the desired output. Some of the important tags of HTML are discussed
below -
Tags in html are useful entities that allow a developer to manipulate the
look and functionalities of a web page. Additionally, some of the tags have
closing tags that include a forward slash, indicating a closing tag.
Examples of the closing tags are body, title, and html. However, some
tags do not have closing tags; examples of such tags are <br>
and <img>. Such elements are often known as empty or void elements in
HTML.
Example
<p>An <abbr title = "Hypertext Markup language">HTML </abbr>language is
used to create web pages. </p>
Output:
HTML Link Tags
<a>
Example:
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title></title>
5. </head>
6. <body>
7. <p>Click on <a href="https://www.javatpoint.com/" targe
t="_blank"> this-link </a>to go on home page of JavaTpoint.</p>
8. </body>
9. </html>
Note:
o The target attribute can only use with href attribute in anchor tag.
o If we will not use target attribute then link will open in same page.
3) width
It is an optional attribute which is used to specify the width to display the
image. It is not recommended now. You should apply CSS in place of width
attribute.
4) height
It h3 the height of the image. The HTML height attribute also supports
iframe, image and object elements. It is not recommended now. You
should apply CSS in place of height attribute.
Example:
1. <img src="animal.jpg" height="180" width="300" alt="animal ima
ge">
Example:
1. <a href="https://www.javatpoint.com/what-is-robotics"><img sr
c="robot.jpg" height="100" width="100"></a>
HTML Lists Tag:
HTML Lists are used to specify lists of information. All lists may contain
one or more list elements. There are three different types of HTML lists:
1. <ol>
2. <li>sql</li>
3. <li>MongoDB</li>
4. <li>IBMdb2</li>
5. <li>Oracle</li>
6. </ol>
ol type="I"
Let's see the example to display list in roman number uppercase.
1. <ol type="I">
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ol>
Test it Now
Output:
I. HTML
II. Java
III. JavaScript
IV. SQL
ol type="i"
Let's see the example to display list in roman number lowercase.
1. <ol type="i">
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ol>
Test it Now
Output:
i. HTML
ii. Java
iii. JavaScript
iv. SQL
ol type="A"
Let's see the example to display list in alphabet uppercase.
1. <ol type="A">
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ol>
Test it Now
Output:
A. HTML
B. Java
C. JavaScript
D. SQL
ol type="a"
Let's see the example to display list in alphabet lowercase.
1. <ol type="a">
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ol>
Test it Now
Output:
a. HTML
b. Java
c. JavaScript
d. SQL
start attribute
The start attribute is used with ol tag to specify from where to start the
list items.
<ol type="1" start="5"> : It will show numeric values starting with "5".
<ol type="I" start="5"> : It will show Roman upper case value starting
with "V".
<ol type="i" start="5"> : It will show Roman lower case value starting
with "v".
Output:
v. HTML
vi. Java
vii. JavaScript
viii. SQL
reversed Attribute:
This is a Boolean attribute of HTML <ol> tag, and it is new in HTML5
version. If you use the reversed attribute with
tag then it will numbered the list in descending order (7, 6, 5, 4......1).
Example:
1. <ol reversed>
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ol>
Test it Now
Output:
o disc
o circle
o square
o none
Type "disc" This is the default style. In this style, the list items are marked with bullets.
Type "circle" In this style, the list items are marked with circles.
Type "square" In this style, the list items are marked with squares.
Type "none" In this style, the list items are not marked .
Output:
o HTML
o Java
o JavaScript
o SQL
ul type="circle"
1. <ul type="circle">
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ul>
Output:
o HTML
o Java
o JavaScript
o SQL
ul type="square"
1. <ul type="square">
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ul>
Test it Now
Output:
HTML
Java
JavaScript
SQL
ul type="none"
1. <ul type="none">
2. <li>HTML</li>
3. <li>Java</li>
4. <li>JavaScript</li>
5. <li>SQL</li>
6. </ul>
Test it Now
Output:
o HTML
o Java
o JavaScript
o SQL
1. <dl>
2. <dt>HTML</dt>
3. <dd>is a markup language</dd>
4. <dt>Java</dt>
5. <dd>is a programming language and platform</dd>
6. <dt>JavaScript</dt>
7. <dd>is a scripting language</dd>
8. <dt>SQL</dt>
9. <dd>is a query language</dd>
10.</dl>
Test it Now
Output:
HTML
is a markup language
Java
is a scripting language
SQL
is a query language
HTML Table
HTML table tag is used to display data in tabular form (row * column).
There can be many columns in a row.
In Each table, table row is defined by <tr> tag, table header is defined by
<th>, and table data is defined by <td> tags.
HTML tables are used to manage the layout of the page e.g. header
section, navigation bar, body content, footer section etc. But it is
recommended to use div tag over table to manage the layout of the
page .
1. <table>
2. <tr><th>First_Name</th><th>Last_Name</th><th>Marks</
th></tr>
3. <tr><td>Sonoo</td><td>Jaiswal</td><td>60</td></tr>
4. <tr><td>James</td><td>William</td><td>80</td></tr>
5. <tr><td>Swati</td><td>Sironi</td><td>82</td></tr>
6. <tr><td>Chetna</td><td>Singh</td><td>72</td></tr>
7. </table>
1. <table border="1">
2. <tr><th>First_Name</th><th>Last_Name</th><th>Marks</
th></tr>
3. <tr><td>Sonoo</td><td>Jaiswal</td><td>60</td></tr>
4. <tr><td>James</td><td>William</td><td>80</td></tr>
5. <tr><td>Swati</td><td>Sironi</td><td>82</td></tr>
6. <tr><td>Chetna</td><td>Singh</td><td>72</td></tr>
7. </table>
It will divide one cell/row into multiple columns, and the number of
columns depend on the value of colspan attribute.
1. <table style="width:100%">
2. <tr>
3. <th>Name</th>
4. <th colspan="2">Mobile No.</th>
5. </tr>
6. <tr>
7. <td>Ajeet Maurya</td>
8. <td>7503520801</td>
9. <td>9555879135</td>
10. </tr>
11. </table>
It will divide a cell into multiple rows. The number of divided rows will
depend on rowspan values.
1. <table>
2. <tr><th>Name</th><td>Ajeet Maurya</td></tr>
3. <tr><th rowspan="2">Mobile No.</th><td>7503520801</
td></tr>
4. <tr><td>9555879135</td></tr>
5. </table>
HTML Form
An HTML form is a section of a document which contains controls such as
text fields, password fields, checkboxes, radio buttons, submit button,
menus etc.
An HTML form facilitates the user to enter data that is to be sent to the
server for processing such as name, email address, password, phone
number, etc. .
Tag Description
Note: The <form> element does not itself create a form but it is container to
contain all required form elements, such as <input>, <label>, etc.
Syntax:
1. <form>
2. //Form elements
3. </form>
Example:
1. <body>
2. <form>
3. Enter your name <br>
4. <input type="text" name="username">
5. </form>
6. </body>
Output:
1. <form>
2. First Name: <input type="text" name="firstname"/> <br/>
3. Last Name: <input type="text" name="lastname"/> <br/>
4. </form>
Output:
Note: If you will omit 'name' attribute then the text filed input will not be submitted
to server.
Example:
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title>Form in HTML</title>
5. </head>
6. <body>
7. <form>
8. Enter your address:<br>
9. <textarea rows="2" cols="20"></textarea>
10. </form>
11. </body>
12.</html>
Output:
HTML Password Field Control
The password is not visible to the user in password field control.
1. <form>
2. <label for="password">Password: </label>
3. <input type="password" id="password" name="password
"/> <br/>
4. </form>
Output:
1. <form>
2. <label for="email">Email: </label>
3. <input type="email" id="email" name="email"/> <br/>
4. </form>
If you use one name for all the radio buttons, only one radio button can be
selected at a time.
Using radio buttons for multiple options, you can only choose a single
option at a time.
1. <form>
2. <label for="gender">Gender: </label>
3. <input type="radio" id="gender" name="gender" value="
male"/>Male
4. <input type="radio" id="gender" name="gender" value="femal
e"/>Female <br/>
5. </form>
Checkbox Control
The checkbox control is used to check multiple options from given
checkboxes.
1. <form>
2. Hobby:<br>
3. <input type="checkbox" id="cricket" name="cricket" valu
e="cricket"/>
4. <label for="cricket">Cricket</label> <br>
5. <input type="checkbox" id="football" name="football" val
ue="football"/>
6. <label for="football">Football</label> <br>
7. <input type="checkbox" id="hockey" name="hockey" val
ue="hockey"/>
8. <label for="hockey">Hockey</label>
9. </form>
Output:
Submit button control
HTML <input type="submit"> are used to add a submit button on web
page. When user clicks on submit button, then form get submit to the
server.
Syntax:
Example:
1. <form>
2. <label for="name">Enter name</label><br>
3. <input type="text" id="name" name="name"><br>
4. <label for="pass">Enter Password</label><br>
5. <input type="Password" id="pass" name="pass"><br>
6. <input type="submit" value="submit">
7. </form>
Output:
HTML Form Example
Following is the example for a simple form of registration.
1. <!DOCTYPE html>
2. <html>
3. <head>
4. <title>Form in HTML</title>
5. </head>
6. <body>
7. <h2>Registration form</h2>
8. <form>
9. <fieldset>
10. <legend>User personal information</legend>
11. <label>Enter your full name</label><br>
12. <input type="text" name="name"><br>
13. <label>Enter your email</label><br>
14. <input type="email" name="email"><br>
15. <label>Enter your password</label><br>
16. <input type="password" name="pass"><br>
17. <label>confirm your password</label><br>
18. <input type="password" name="pass"><br>
19. <br><label>Enter your gender</label><br>
20. <input type="radio" id="gender" name="gender" value="male"/
>Male <br>
21. <input type="radio" id="gender" name="gender" value
="female"/>Female <br/>
22. <input type="radio" id="gender" name="gender" value="others"/
>others <br/>
23. <br>Enter your Address:<br>
24. <textarea></textarea><br>
25. <input type="submit" value="sign-up">
26. </fieldset>
27. </form>
28. </body>
29. </html>
Test it Now
Output:
o Static Website
o Dynamic Website
Static website
Static website is the basic type of website that is easy to create. You don't
need the knowledge of web programming and database design to create a
static website. Its web pages are coded in HTML.
The codes are fixed for each page so the information contained in the
page does not change and it looks like a printed page.
Dynamic website
Dynamic website is a collection of dynamic web pages whose content
changes dynamically. It accesses content from a database or Content
Management System (CMS). Therefore, when you alter or update the
content of the database, the content of the website is also altered or
updated.
Client side scripting generates content at the client computer on the basis
of user input. The web browser downloads the web page from the server
and processes the code within the page to render information to the user.
In server side scripting, the software runs on the server and processing is
completed in the server then plain pages are sent to the user.
Prebuilt content is same every time the Content is generated quickly and chan
page is loaded. regularly.
It uses the HTML code for developing a It uses the server side languages s
website. as PHP,SERVLET, JSP, and ASP.NET etc.
developing a website.
It sends exactly the same response for It may generate different HTML for each of
every request. request.
The content is only changed when someone The page contains "server-side" code which all
publishes and updates the file (sends it to the server to generate the unique content w
the web server). the page is loaded.
Flexibility is the main advantage of static Content Management System (CMS) is the m
website. advantage of dynamic website.
If you plan to use any of the special characters on this page, you should
use either the HTML entity name or the HTML entity number. This will
ensure that it displays correctly in most/all browsers.
For example, if you want to display a copyright symbol "©", you should
use either © or © in your code.
SGML
<EMAIL>
<SENDER>
<PERSON>
<FIRSTNAME>GEEKS FOR GEEKS</FIRSTNAME>
</PERSON>
</SENDER>
<BODY>
<p>A Computer Science Portal For Geeks</p>
</BODY>
</EMAIL>
Output:
simple Paragraph
<EMAIL>
<RECEIVER>
<PERSON>
<FIRSTNAME>Krishna</FIRSTNAME>
</PERSON>
</RECEIVER>
<BODY>
<p>It is a name of the person.</p>
</BODY>
</EMAIL>
Output:
o HTML5 supports both audio and video while none of them were part of
o HTML cannot allow JavaScript to run within the web browser,
while HTML5 provides full support for running JavaScript.
o In HTML5, inline mathML and SVG can be used in a text, while in HTML it
is not possible.
o HTML5 supports new types of form controls, such as date and time,
email, number, category, title, Url, search, etc.
o Many elements have been introduced in HTML5. Some of the most
important are time, audio, description, embed, fig, shape, footer,
article, canvas, navy, output, section, source, track, video, etc.
Multimedia Language in HTML does not have support for HTML5 supports both video
support video and audio. audio.
Storage The HTML browser uses cache memory as HTML5 has the storage opt
temporary storage. like:application cache, S
database, and web storage.
Browser HTML is compatible with almost all browsers In HTML5, we have many
compatibilit because it has been present for a long time, tags, elements, and some t
y and the browser made modifications to that h
support all the features. been removed/modified, so o
some browsers are f
compatible with HTML5.
Graphics In HTML, vector graphics are possible with In HTML5, vector graphics
support tools LikeSilver light, Adobe Flash, supported by default.
VML, etc.
Threading In HTML, the browser interface and JavaScript The HTML5 has the JavaSc
running in the same thread. Web Worker API, which allows
browser interface to run
multiple threads.
Vector and Vector graphics are possible with the help of Vector graphics is an integral
Graphics technologies like VML, Silverlight, of HTML5, SVG and canvas.
Flash,etc.
Shapes It is not possible to create shapes like circles, We can draw shapes like circ
rectangles, triangles. rectangles, triangles.
Doc type Doctype declaration in html is too long The DOCTYPE declaration in ht
<! DOCTYPE HTML PUBLIC "- // W3C // DTD is very simple "<! DOCT
HTML 4.01 // EN" html>
"http://www.w3.org/TR/html4/strict.dtd">
Multimedia Audio and video are not the part of HTML4. Audio and video are essen
support parts of HTML5,like: <Audi
<Video>.
Vector In HTML4, vector graphics are possible with Vector graphics are an inte
Graphics the help of techniques like VML, Silver light part of HTML5, S
and Flash. and canvas.
Shapes It is not possible to draw shapes like circles, Using html5, you can draw sha
rectangles, triangles. like circles, rectang
triangles.
Browser Works with all older browsers A new browser supports this.
Support