View Full Version : Resolved aligning a button correctly with out using floats?

09-12-2011, 07:04 PM
hi all

im trying to get the use code buttons to go along side the code and descriptions and not underneath, ive tried using floats but they mess the page up does anyone know how to position them?

here is my html

<div class="discountcode">
<div class="codeDetails">
<span class="codeID"><?php echo $row['code']?>:</span>
<?php echo $row['details']."<br /><span style='color:#FF0000'>Exipres in: <b>".findTime($timestamp, $format)."</b></span>"?>
<span class="usecodeBtn">
<a id="usecode" href="<?php echo htmlspecialchars($row['codeLink'])?>" target="_blank" title="Use Code"><span>Use Code</span></a>

and the css

display: block;
width: 120px;
height: 29px;
background: url("/images/Use Code_0.png") no-repeat 0 0;

background: url("/images/Use Code_1.png") no-repeat 0 0;

#usecode span
position: absolute;
top: -999em;
.discountcode{width:510px; margin-bottom:5px;border:1px dashed #CCCCCC; padding:5px;}
.storeName{font-weight:bold; color:#CC0000; margin-top:10px; margin-bottom:10px; font-size:14px;}
.codeID{margin:0; padding:0; font-size:12px; font-weight:bold; padding-top:3px; padding-bottom:3px;}
.usecodeBtn{width:100px; margin-top:10px;}

any help is appreciated