PDA

View Full Version : opening a DIV



emanuelle
03-20-2007, 09:49 AM
I would like to open a div on my page from a link.

mburt
03-20-2007, 10:52 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>DIV Display</title>
<script type="text/javascript">
function show(element) {
var el = document.getElementById(element);
el.style.display = "block";
}
</script>
</head>
<body>
<a href="#" onclick="show('myDivBlock')">Show DIV</a>
<div id="myDivBlock" style="display:none;">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam quis augue. Ut quis ligula. Pellentesque nibh dolor,
commodo eu, dapibus congue, euismod id, nisi. Pellentesque iaculis placerat tellus. Nulla varius est tristique libero.
Ut sed dui. Praesent nunc. Nunc sit amet velit at lectus adipiscing tempus. Nulla lorem urna, tincidunt eget, fermentum
eu, vulputate sed, nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
</div>
</body>
</html>

emanuelle
03-20-2007, 11:57 AM
txs a lot.

is there a simple way to make the bg color of the div a bit transparent?(opacity)
Only the bgcolor, not the text

codeexploiter
03-20-2007, 01:33 PM
check this (http://www.mandarindesign.com/opacitycolor.html) out

mburt
03-20-2007, 01:46 PM
is there a simple way to make the bg color of the div a bit transparent?(opacity)
Only the bgcolor, not the text
The CSS way of doing it makes the text change (transparent) as well. Use a background image, and make it transparent using a image-editing program.