IT1100 IWT - Labsheet 03
IT1100 IWT - Labsheet 03
Objectives
By the end of this lab session, you will be able to design your web page using styles.
Introduction
• CSS Stands for "Cascading Style Sheet" and used to format the layout of Web pages.
• It can control the layout of multiple web pages all at once.
• External style sheets are stored in CSS files. (This method is the preferred one)
• Internal Styles and Inline styles include in HTML file.
o Internal Styles
Internal styles are defined inside of <style> element which is inside <head>
element.
This method uses if only a single page has a unique style.
o Inline Styles
Inline styles define inside the exact element. This uses when that specific element
has a unique style.
• Class and Id
Both classes and Ids work as selectors in HTML. The advantage of these are they can use
same HTML tag but view or display it in different ways.
o Class
In CSS class selector is a name proceed by a (.).
Following is an example of class selector.
In HTML In CSS
.classExample{
<div class=”classExample”> Background-color: white;
}
o Id
In css class selector is a name proceed by a (#).
Following is an example of class selector.
In HTML In CSS
<div class=”idExample”> #idExample{
Background-color: white; }
BSc (Hons) in Information Technology
Year 1, Semester II, 2024
IT1100 – Internet and Web Technologies
• Logo
o Create a CSS class named “logo” in styles.css. Use following example in order to
center your Logo.
https://www.w3schools.com/howto/howto_css_image_center.asp
o Call the class named logo (created in the previous step) to the <img> tag in
index.html. (Introduction to classes and Ids are containing in the introduction
section of this lab sheet)
• Headers
o Change the font type and font size of the headers using following example.
https://www.w3schools.com/css/css_font.asp
BSc (Hons) in Information Technology
Year 1, Semester II, 2024
IT1100 – Internet and Web Technologies
• Horizontal Line
o Format the horizontal line in index.html as 1px thick (Using a border) and Color of
the horizontal line as black.
https://www.w3schools.com/howto/howto_css_style_hr.asp
• Table
o Add the complete table inside a <div> tag.
o Add a class named “productData” in styles.css in order to change the background
color of the table.
o Call the “productData” inside the div tag.
https://www.w3schools.com/cssref/pr_background-image.asp
• Footer
o Align the texts center.
o Change the font style of the text.
BSc (Hons) in Information Technology
Year 1, Semester II, 2024
IT1100 – Internet and Web Technologies
Exercise 2: