Hi there ETpro,
Check out these examples, one of them may help...
1. very basic:-
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<style type="text/css">
body {
background-color:#00f;
}
#container {
position:relative;
width:440px;
margin:auto;
}
#faded {
width:400px;
height:360px;
padding:40px;
background-color:#f00;
border:4px solid #000;
opacity:0.30;
filter:alpha(opacity=30);
font-size:30px;
font-weight:bold;
text-align:center;
}
#unfaded {
position:absolute;
z-index:1;
left:84px;
top:189px;
width:300px;
padding:10px;
border:2px solid #000;
font-size:30px;
font-weight:bold;
text-align:center;
background-color:#fff;
}
</style>
</head>
<body>
<div id="container">
<div id="faded">this area is effected by opacity</div>
<div id="unfaded">this area is unaffected</div>
</div>
</body>
</html>
2. more involved:-
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<style type="text/css">
body{
background-color:#000;
}
#box{
width:770px;
height:535px;
margin:30px auto;
border:5px double #f60;
background-image:url(http://www.coothead.co.uk/images/buddha.jpg);
background-repeat:no-repeat;
}
#container{
position:relative;
width:326px;
height:202px;
padding:1px;
border:3px inset #333;
margin:162px auto 0;
}
#background {
position:absolute;
width:324px;
height:170px;
padding-top:30px;
background-color:#f93;
opacity:0.4;
filter:alpha(opacity=50);
font-size:20px;
font-weight:bold;
text-align:center;
}
#foreground {
position:absolute;
width:324px;
border:1px solid #000;
line-height:200px;
font-size:20px;
font-weight:bold;
text-align:center;
}
</style>
</head>
<body>
<div id="box">
<div id="container">
<div id="background">This is the Background</div>
<div id="foreground">This is the Foreground</div>
</div>
</div>
</body>
</html>
coothead
Bookmarks