batterdmooie
11-21-2007, 12:36 PM
Hi, is there any way of having a plain rollover button, and text styled using css centred over the top??
I have the rollover working perfectly, but I can’t get my text to align vertically, I have used padding, but it throws the rollover out.
I am probably going about it totally the wrong way, so any help would be appreciated. Is there an easier way of styling and centring text?
Here is my code:
<!--
.Button
{float:left;
width: 180px;
height: 40px;}
.Button a
{display: block;
width: 180px;
height: 40px;
background: url(images/button1.jpg) no-repeat top left;
text-decoration: none}
.Button a:hover
{background-position: bottom left;}
.alttext
{font-family: arial, helvetica, sans-serif;
font-weight: bold;
color: white;
padding: 10px;
text-align: center;}
-->
<div class="Button"><a href="link.html">
<span class="alttext">ABOUT </span></a></div>
I have the rollover working perfectly, but I can’t get my text to align vertically, I have used padding, but it throws the rollover out.
I am probably going about it totally the wrong way, so any help would be appreciated. Is there an easier way of styling and centring text?
Here is my code:
<!--
.Button
{float:left;
width: 180px;
height: 40px;}
.Button a
{display: block;
width: 180px;
height: 40px;
background: url(images/button1.jpg) no-repeat top left;
text-decoration: none}
.Button a:hover
{background-position: bottom left;}
.alttext
{font-family: arial, helvetica, sans-serif;
font-weight: bold;
color: white;
padding: 10px;
text-align: center;}
-->
<div class="Button"><a href="link.html">
<span class="alttext">ABOUT </span></a></div>