Professional Documents
Culture Documents
General Instructions
1. Implement all the programs give using text editor to make yourself used to CSS syntax and
its properties
2. Attempt all questions relating to each program
3. In first place, try working independently, in case you face any difficulties you may discuss
with your fellows or you consult me(Instructor)
4. To have more understanding on these programs, you are advised to make some modification
in some properties so that you can experience different results
1|Page
DIT 0211: LAB 2
<html>
<head>
<title>CSS rules and External linking</title>
</head>
<body>
<h1>CSS test</h1>
<p>
The book required should have a cover colored <span
class="blue"> light blue </span> and
papers with <span class="green"> dark green </span>
background.
</p>
</body>
</html>
Program 1.2
h1{
font-size: 20px;
text-align: center;
color: #3feb14;
}
span.blue{
color:lightskyblue; font-weight:bold;
}
span.green{
color:darkolivegreen; font-weight:bold;
}
2|Page
DIT 0211: LAB 2
<style type="text/css">
body { background-color:red;}
h1 { color:orange; text-align:center;}
p { font-family: "Times new roman "; font-size: 20px;}
</style>
4. In <h1> add the attribute style whose value is font-style:italic; to add
internal stylesheet i.e. style=font-style:italic .
NB: To add internal stylesheet, add the style attribute to the selected HTML that you need
to apply your CSS code and then write your CSS properties as attribute values of such style
attribute
5. Save the changes you have made in program2.html and preview(refresh) it
6. If you observe the changes , then you have successfully and correctly implemented Inline
and internal CSS linking the given HTML file
3|Page
DIT 0211: LAB 2
4|Page
DIT 0211: LAB 2