Log in

View Full Version : Div in a fieldset



Webiter
06-09-2012, 02:05 PM
The following HTML is a validation at the end of a form to prevent spam. It looks like the image attached.


<fieldset>
<legend>Validate Your Message <span class="errors">Error message here<?php echo $visitorcodeErr ?></span></legend>
<span class="required">Required</span>
<center>
<img src="randomImage.php" alt="Captcha Image"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="visitorcode" class="data" size="6" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<!--Refresh Validate Code Button Facility-->
<a href><img src="refresh.jpg" onclick="history.go()" alt="Refresh Code" /></a>
</center>
</fieldset>

Seeking to activate the refresh image as a sprite using the css control below.


/*Refresh Validate Code Rollover*/
#flip {border: 0px; font-size: 0px; width: 35px; height: 35px;}
#flip a {background: url(./refresh.jpg); display: block; width: 35px;height: 35px;}
#flip a.link {background-position: 0px 0px;}
#flip a.link:hover {background-position: 0 bottom;}

The rollover works in a normal <div>. Have tried the <div> within the fieldset but positioning is then out. Is there a work around or diff approach?

bernie1227
06-12-2012, 09:25 AM
my advice is not to use no-space breaks in order to position the items. instead, use css positioning in order to do it.

In other words, set each item an id, and position them using


position: absolute;

and then using left or right controls, margins and padding in order to achieve it. Hopefully then the frameset won't effect the box.

Tell me if you have any problems.

ApacheTech
07-02-2012, 04:06 PM
Also, get rid of the <center></center> tags. Use css to centre things.