I am using a block element to roll over div background images.
This works fine but I want to display text, vertically centered in the same div. The text is being read from a perl script and varies in length, so the alignment needs to be automatic.
Any attempt to pad the text, results in the background image being padded too.
What can you suggest to do this?
Keith
This works fine but I want to display text, vertically centered in the same div. The text is being read from a perl script and varies in length, so the alignment needs to be automatic.
Any attempt to pad the text, results in the background image being padded too.
What can you suggest to do this?
Code:
Style in stylesheet
.offerim{
width:218px;
height:327px;
float:left;
font-size:20px;
text-align:center;
display:block;
}
.offerim a{
width:218px;
height:327px;
color:#ff0000;
display:block;
background-image: url('my_image');
}
.offerim a:hover{
width:218px;
height:327px;
color:#ffffff;
display:block;
background-image: url('my_hover_image');
}
------------------------------------------------------------------
Div in page
<div class='offerim'>
<a href='my_link'>
<!--#include virtual="cgi-bin/my_perl_script"-->
</a>
</div>
Keith