WEEK 4 Design A Web Page Using CSS (Cascading Style Sheets)
WEEK 4 Design A Web Page Using CSS (Cascading Style Sheets)
------------------------------------------------------------------------------------------------------------
AIM:
Design a web page using CSS (Cascading Style Sheets) which includes the following:
1) Use different font, styles: In the style definition you define how each selector should work. Then,
in the body of your pages, you refer to these selectors to activate the styles.
2) Set a background image for both the page and single elements on the page.
3) Control the repetition of the image with the background-repeat property
DESCRIPTION:
An inline style (inside an HTML element) has the highest priority, which means that it will
override a style declared inside the <head> tag, in an external style sheet, or in a browser (a default
value).
Syntax
The CSS syntax is made up of three parts: a selector, a property and a value:
Inline Styles
An inline style loses many of the advantages of style sheets by mixing content with
presentation. Use this method sparingly, such as when a style is to be applied to a single
occurrence of an element.
To use inline styles you use the style attribute in the relevant tag. The style attribute can contain
any CSS property.
<p style="color: sienna; margin-left: 20px">
This is a paragraph </p>
PROGRAM:
Cas.css:
a:link{color:black;}
a:visited{color:pink;}
a:active{color:red;}
a:hover{color:green;}
.right {
text-align:center;
text-decoration:underline;
font-weight:bold;
color:blue;
font-family:comic sans ms;
font-size:30; }
.image {
text-align:left;
font-family:"monotype corsiva";
font-weight:10;
}
.image1 {
background-image:url("C:\Documents and Settings\All Users\My Documents\My Pictures\krishna.jpg");
background-attachment:fixed;
background-repeat:no-repeat;
width:150;
height:150; }
table { align:center;border:10;
border-style:ridge;
border-color:yellow;}
htm.html:
<html>
<head>
<link rel="stylesheet" href="cas.css" type="text/css">
<style>
.xlink{ text-decoration:none;font-weight:bold;cursor:crosshair;}
.ylink{text-decoration:underline;font-weight:bold;cursor:help;}
</style>
</head>
<body class="image">
<p style="text-align:right;">
<a href="registration.html" class="xlink"> Reg Link</a>
<a href="topframe.html" class="ylink"> Help Link</a>
</p>
<p class="right">PVPSIT</p>
<div style="position:relative;font-size:90px;z-index:5;color:purple;">PVPSIT</div>
<div style="position:relative;font-size:50px;z-index:1;top:-70; left:5;color:blue;">CSE</div>
<div style="position:relative;font-size:90px;z-index:1;color:purple;">PVPSIT</div>
<div style="position:relative;font-size:50px;z-index:5;top:-70; left:5;color:blue;">CSE</div>
<table align="center" class="image1">
<tr>
<td> Fruits</td>
<td> Mango</td>
</tr>
</table>
</body>
</html>
OUTPUT: