docock
07-16-2011, 05:15 PM
I've got an image from 196x196 px on my website.
I've placed aa 196x30 px transparent div on top of it, on the bottom of the image.
For some strange reason the transparent div hasn't got a width from 196px, how can I alter the coding so that the width will be 196px ?
Second, how can I vertical align the text ? It looks okay on IE now, but if I test it with firefox the text is too high. I know I can set a margin for it, but then the text in IE would be too low.
<html>
<head>
<style type="text/css">
div.transbox
{
width: 169px;
height: 30px;
margin: -37px 0px;
background-color: lime;
border: 0px solid black;
filter:alpha(opacity=60);
opacity:0.6;
position: relative;
}
div.transbox p
{
margin: 5px 0px;
font-weight: bold;
color: #000000;
text-align: center;
}
</style>
</head>
<body><div><img src="fcd4-3f08.jpg">
<div class="transbox">
<p>example text</p>
</div></div>
</body>
</html>
I've placed aa 196x30 px transparent div on top of it, on the bottom of the image.
For some strange reason the transparent div hasn't got a width from 196px, how can I alter the coding so that the width will be 196px ?
Second, how can I vertical align the text ? It looks okay on IE now, but if I test it with firefox the text is too high. I know I can set a margin for it, but then the text in IE would be too low.
<html>
<head>
<style type="text/css">
div.transbox
{
width: 169px;
height: 30px;
margin: -37px 0px;
background-color: lime;
border: 0px solid black;
filter:alpha(opacity=60);
opacity:0.6;
position: relative;
}
div.transbox p
{
margin: 5px 0px;
font-weight: bold;
color: #000000;
text-align: center;
}
</style>
</head>
<body><div><img src="fcd4-3f08.jpg">
<div class="transbox">
<p>example text</p>
</div></div>
</body>
</html>