Iict Week 04 & 05
Iict Week 04 & 05
Information and
Communication
Technology Lab
Semester 01 (Fall 2021)
Lab Engineer(s): Ms. Sidra Rani
Objective(s):
By the end of this lab, you should have an understanding of simple HTML tags, and you should
know how to create, edit, and publish your own webpage.
4.1 Description:
First developed by Tim Berners-Lee in 1990, HTML is short for Hypertext Markup Language.
HTML is used to create electronic documents (called pages) that are displayed on the World
Wide Web. Each page contains a series of connections to other pages called hyperlinks. Every
web page you see on the Internet is written using one version of HTML code or another.
HTML code ensures the proper formatting of text and images for your Internet browser. Without
HTML, a browser would not know how to display text as elements or load images or other
elements. HTML also provides a basic structure of the page, upon which Cascading Style Sheets
are overlaid to change its appearance. One could think of HTML as the bones (structure) of a
web page, and CSS as its skin (appearance).
Because HTML is a markup language, it can be created and viewed in any text editor if saved
with a .htm or .html file extension. However, most find it easier to design and create web pages
in HTML using an HTML editor.
Once the HTML file is created, it can be viewed locally or uploaded to a web server to be viewed
online using a browser.
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Introduction to
Information and
Communication
Technology Lab
Semester 01 (Fall 2021)
Lab Engineer(s): Ms. Sidra Rani
</body>
</html>
An HTML element is defined by a start tag, some content, and an end tag:
The HTML element is everything from the start tag to the end tag:
</body>
</html>
Example Explained:
The <head> element contains meta information about the HTML page
The <title> element specifies a title for the HTML page (which is shown in the browser's title bar
or in the page's tab)
The <body> element defines the document's body, and is a container for all the visible contents,
such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
HTML Headings:
<h1> defines the most important heading. <h6> defines the least important heading:
HTML Paragraphs:
HTML Links:
HTML Images:
The source file (src), alternative text (alt), width, and height are provided as attributes:
Example:
<img src="My image.jpg" alt="The image is missing" width="104" height="142">
Introduction to
Information and
Communication
Technology Lab
Semester 01 (Fall 2021)
Lab Engineer(s): Ms. Sidra Rani
Exercises
Exercise 1
Exercise 2
Develop static pages (using Only HTML) of an online Book store. The pages should resemble:
www.amazon.com
The website should consist the following pages.
1. Home page
2. Registration
3. user Login
4. User Profile Page
5. Books catalog
Introduction to
Information and
Communication
Technology Lab
Semester 01 (Fall 2021)
Lab Engineer(s): Ms. Sidra Rani
What is CSS?
Cascading Style Sheet(CSS) is used to set the style in web pages that contain HTML elements.
It sets the background color, font-size, font-family, color, … etc property of elements on a web
page.
Inline CSS
Internal or Embedded CSS
External CSS
Inline CSS: Inline CSS contains the CSS property in the body section attached with element is
known as inline CSS. This kind of style is specified within an HTML tag using the style
attribute.
Example:
<html>
<head>
<title>Inline CSS</title>
</head>
<body>
<p style = "color : #009900; font-size : 50px ; font-style : italic; text-align : center;">
“Intro to CSS” </p>
</body>
Introduction to
Information and
Communication
Technology Lab
Semester 01 (Fall 2021)
Lab Engineer(s): Ms. Sidra Rani
</html>
<html>
<head>
<title>Internal CSS</title>
<style>
.main {
text-align:center;
}
.ITCSS {
color:#009900;
font-size:50px;
font-style:bold;
}
.IICT {
font-style:bold;
font-size:20px;
}
</style>
</head>
<body>
<div class = "main">
External CSS:
External CSS contains separate CSS file which contains only style property with the help of
tag attributes (For example class, id, heading, … etc). CSS property written in a separate file
with .css extension and should be linked to the HTML document using link tag. This means
that for each element, style can be set only once and that will be applied across web pages.
Example: The file given below contains CSS property. This file saves with .css extension. For
Ex: style.css
body {
background-color : powerblue;
.main {
text-align:center;
}
.ITCSS {
color:#009900;
font-size:50px;
Introduction to
Information and
Communication
Technology Lab
Semester 01 (Fall 2021)
Lab Engineer(s): Ms. Sidra Rani
font-style:bold;
}
.IICT {
font-style:bold;
font-size:20px;
}
Below is the HTML file that is making use of the created external style sheet
link tag is used to link the external style sheet with the html webpage.
href attribute is used to specify the location of the external style sheet file.
<html>
<head>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<div class = "main">
<div id ="IICT">
A computer science Introductory Subject for 1st Semester Students.
</div>
</div>
</body>
</html>