Professional Documents
Culture Documents
______________________________________________________________________________
PRACTICAL NO: 5
AIM: Study all CSS properties and Prepare a CSS reference sheet in
following format:
body {
background-image: url("img_tree.gif");
background-repeat: no-repeat;
background-attachment: fixed;
}
background-color The background-color property sets the background color of an element.
body {
______________________________________________________________________________
Page: 12
Practical No: 5 160050107073
______________________________________________________________________________
background-image: url("paper.gif");
background-color: #cccccc;
}
border-bottom The border-bottom property is a shorthand property for (in the following
order):
border-bottom-width
border-bottom-style
border-bottom-color
h1 {
border-bottom: 5px solid red;
}
h2 {
border-bottom: 4px dotted blue;
}
div {
border-bottom: double;
}
border-color The border-color property sets the color of an element's four borders.
div.a {
font-size: 15px;
}
div.b {
font-size: large;
}
div.c {
font-size: 150%;
______________________________________________________________________________
Page: 13
Practical No: 5 160050107073
______________________________________________________________________________
}
font-style The font-style property specifies the font style for a text.
p.a {
font-style: normal;
}
p.b {
font-style: italic;
}
p.c {
font-style: oblique;
}
list-style-type
list-style-position
list-style-image
ul {
list-style: square inside url("sqpurple.gif");
}
margin The margin property sets the margins for an element, and is a shorthand
property for the following properties:
margin-top
margin-right
margin-bottom
margin-left
p{
margin: 35px;
}
outline The outline property is a shorthand property for:
outline-width
outline-style (required)
outline-color
h2 {
outline: 5px dotted green;
}
div.a {
outline: 2px dashed blue;
}
______________________________________________________________________________
Page: 14
Practical No: 5 160050107073
______________________________________________________________________________
Padding An element's padding is the space between its content and its
border.The padding property is a shorthand property for:
padding-top
padding-right
padding-bottom
padding-left
p{
padding: 35px;
}
text-align The text-align property specifies the horizontal alignment of text in an
element.
div.a {
text-align: center;
}
vertical-align The vertical-align property sets the vertical alignment of an element.
img.a {
vertical-align: baseline;
}
white-space The white-space property specifies how white-space inside an element is
handled.
p.a {
white-space: nowrap;
}
______________________________________________________________________________
Page: 15
Practical No: 6 160050107073
______________________________________________________________________________
PRACTICAL NO: 6
AIM: A. Create a HTML table of your choice and do the followings using
internal CSS:
1. Set solid border with width 2px and blue color
2. Set first row as header with dark gray color and bold text
3. Set background of odd row with #ffffff and even #ddd color code
4. Set #f5f5dc color of row when user hover mouse on it
Code: A
<html>
<head>
<style>
table{
border: 2px solid blue
}
th{
color: DarkGray;
align:center;
}
td{
text-align: left;
}
tr:nth-child(even){background-color: #ddd}
tr:nth-child(odd){background-color: #ffffff}
tr:hover {background-color:f5f5dc;}
</style>
</head>
<body>
<table border="1" width="50%">
<tr>
<th colspan="4">GAME INFORMATION</th>
______________________________________________________________________________
Page: 16
Practical No: 6 160050107073
______________________________________________________________________________
</tr>
<tr>
<td>LISTS</td>
<td>MILAN</td>
<td>HIMANSHU</td>
<td>JAY</td>
</tr>
<tr>
<td>Basketball</td>
<td>YES</td>
<td>NO</td>
<td>NO</td>
</tr>
<tr>
<td>Cricket</td>
<td>YES</td>
<td>YES</td>
<td>YES</td>
</tr>
<tr>
<td>Studies</td>
<td>NO</td>
<td>NO</td>
<td>YES</td>
</tr>
<tr>
<td>Counter strike</td>
<td>YES</td>
<td>YES</td>
<td>YES</td>
</tr>
</table>
</body>
</html>
______________________________________________________________________________
Page: 17
Practical No: 6 160050107073
______________________________________________________________________________
Code: B
<html>
<head>
<style>
ol {
list-style: square inside url("123.jpg");
list-style-position: outside;
padding:20px;
}
</style>
</head>
<body>
<h1> Friends list</h1>
<ol>
<li>PARTH</li>
<li>HIMANSHU</li>
<li>NISARG</li>
<li>JAY</li>
<li>VRUSHANG</li>
<li>KEVIN</li>
</ol>
</body>
</html>
Screen Short:
______________________________________________________________________________
Page: 18
Practical No: 6 160050107073
________________________________
______________________________________________________________________________
______________
______________________________________________________________________________
________________________________ ______________
Page: 19
Practical No: 7 160050107073
______________________________________________________________________________
PRACTICAL NO: 7
AIM: Write two paragraphs with heading and do the followings using
external CSS:
1. Set text color to color code : #838b8b
2. Set first paragraph left and second paragraph right alignment
3. Headings of paragraph must be in capital letter and underlined
4. Change font to ‘times new roman’
5. User font size 14px and highlight keywords in paragraph with bold
letter .
Code:
.CSS File
p.left{
color: #838b8b;
text-align: left;
}
span.vru{
font-weight: bold;}
span.v{
font-weight: bold;}
span.vv{
font-weight: bold;}
p.right{
color: #838b8b;
text-align: right;
______________________________________________________________________________
Page: 20
Practical No: 7 160050107073
______________________________________________________________________________
.HTML File
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<h1>HTML</h1>
<p class="left">HTML stands for <span class="vru">Hyper Text Markup
Language</span>
HTML describes the structure of Web pages using markup
<span class="vv">HTML</span> elements are the building blocks of <span
class="v">HTML</span> pages
HTML elements are represented by tags</p>
<h1>CSS</h1>
<P class="right">CSS stands for <span class="vru">Cascading Style Sheets</span>
CSS describes how HTML elements are to be displayed on screen, paper, or in other
media
<span class="vv">CSS</span> saves a lot of work. It can control the <span
class="v">layout</span> of multiple web pages all at once
External stylesheets are stored in CSS files</P>
</body>
</html>
Screen Short:
______________________________________________________________________________
Page: 21