Professional Documents
Culture Documents
Static: Static positioned elements are not affected by the top, bottom, left, and right
properties.
Fixed: An element with fixed position is positioned relative to the browser window.
<html>
<head>
<style>
position:fixed;
top:30px;
right:5px;
</style>
</head>
<body>
<body>
</html>
A relative positioned element is positioned relative to its normal position. Relative
positioning changes the position of the HTML element relative to where it normally
appears.
An absolute position element is positioned relative to the first parent element that
has a position other than static.. absolute is positioned at the specified coordinates
relative to your screen top left corner
<html>
<body>
<div style="background-color:yellow;
width:850px;
height:50px;
position:absolute ;
top:40px;
left:290px;
z-index:3;
margin:0px auto;">
</div>
<div style="background-color:black;
width:980px;
height:300px;
position:relative;
top:-60px;
left:35px;
z-index:1;
margin:0px auto;">
</div>
</body>
</html>
The opacity property can take a value from 0.0 - 1.0. A lower value makes the element
more transparent.
<html>
<head>
<style type="text/css">
#img1
opacity:0.4;
filter:alpha(opacity=40);
</style>
</head>
<body>
<img src="index.jpg"><br/><br/>
</body>
</html>
<html>
<head>
<style type="text/css">
img
opacity:0.4;
filter:alpha(opacity=40);
}
img:hover
opacity:1.0;
filter:alpha(opacity=100);
</style>
</head>
<body>
<img src="index.jpg"><br/>
<br/>
</body>
</html>
<html>
<head>
<style>
div.background
width:500px;
height:300px;
background:url(index.jpg) repeat;
div.transbox
width:400px;
height:250px;
margin:30px 50px;
background-color:#ffffff;
opacity:0.6;
filter:alpha(opacity=60);
div.transbox p
margin:30px 40px;
font-weight:bold;
color:#000000;
</style>
</head>
<body>
<div class="background">
<div class="transbox">
<p>CSS stands for Cascading Style Sheet. CSS is used to control the style of a web
document in a simple and easy way. CSS to control the style and layout of multiple
Web pages all at once. Cascading Style Sheets, fondly referred to as CSS, is a simple
design language intended to simplify the process of making web pages
presentable .CSS is created and maintained through a group of people within
</p>
</div>
</div>
</body>
</html>