0% found this document useful (0 votes)
6 views5 pages

Lab 4

The document discusses Cascading Style Sheets (CSS) and how it is used to style HTML elements. CSS can be added to HTML elements in three ways: inline, internally, or externally. The document provides examples of inline and internal CSS and describes how external CSS links a style sheet to HTML pages. It also covers some basic CSS properties like color, font-family, and font-size. A series of tasks are then presented to have students create web pages using CSS.

Uploaded by

ahmedxcheema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Lab 4

The document discusses Cascading Style Sheets (CSS) and how it is used to style HTML elements. CSS can be added to HTML elements in three ways: inline, internally, or externally. The document provides examples of inline and internal CSS and describes how external CSS links a style sheet to HTML pages. It also covers some basic CSS properties like color, font-family, and font-size. A series of tasks are then presented to have students create web pages using CSS.

Uploaded by

ahmedxcheema
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Cascading Style sheet

Objective(s):

 To understand Learn the language of the web CSS.


 To understand how to design web page structure.
 How to Design web page.

Tool(s) used:

For example: Brackets, Notepade.

CSS:

CSS stands for Cascading Style Sheets. CSS describes how HTML elements are to be
displayed on screen, paper, or in other media. CSS saves a lot of work. It can control the
layout of multiple web pages all at once.

CSS can be added to HTML elements in 3 ways:

Inline - by using the style attribute in HTML elements

Internal - by using a <style> element in the <head> section

External - by using an external CSS file

The most common way to add CSS, is to keep the styles in separate CSS files. However, here
we will use inline and internal styling, because this is easier to demonstrate, and easier for
you to try it yourself.

Inline CSS:

An inline CSS is used to apply a unique style to a single HTML element.

An inline CSS uses the style attribute of an HTML element.

This example sets the text color of the <h1> element to blue:

<h1 style="color:blue;">This is a Blue Heading</h1>

Internal CSS:
An internal CSS is used to define a style for a single HTML page.

An internal CSS is defined in the <head> section of an HTML page, within a <style>
element:

External CSS:

 An external style sheet is used to define the style for many HTML pages.

 With an external style sheet, you can change the look of an entire web site, by
changing one file!

 To use an external style sheet, add a link to it in the <head> section of the HTML
page.

CSS Fonts

 The CSS color property defines the text color to be used.


 The CSS font-family property defines the font to be used.
 The CSS font-size property defines the text size to be used.
Tasks:
Task 01. Time: 30 Minutes

Write a code in which Div tag is used with ID and Class and display given below page.
Internal style sheet will be used in this task.

Figure 04-1

Task 02 & 03 Time: 40 Minutes


Create given below table using CSS.

2(i). Font size and style should be same.

2(ii). Cell’s color will be same.

Figure 04-2
Task 04. Time: 40 Minutes

Create given below web page structure using Div(id/class) and CSS.

Figure 04-3
Home Task. Time: 30 Minutes
Create given below page using CSS and forms.

Figure 04-4

You might also like