...

View Full Version : is this not proper?



sackstein
11-01-2010, 08:50 PM
This is currently displaying the way I want it but I am wondering if maybe this is not the right way to do it. I needed a drop down form to be displayed over an image. The easy way to do this was to make the image a background image.

The problem with that was that the background image was loading way after all the images on the page and it was a top banner so that was unacceptable. So what I ended up doing was this:


<div >
<div style="position:relative; top: 268px; left:380px; height:0px; width:200px;"><form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post" >
<label for='selectboxvalue'>Sort by:</label>
<select name="selectboxvalue" onChange="this.form.submit();" id="selectboxvalue" >
<option value="name" <?php if ( $_POST["selectboxvalue"]=="name" ) echo "selected"; ?>>Popular</option>
<option value="pricelow" <?php if ( $_POST["selectboxvalue"]=="pricelow" ) echo "selected"; ?>>
Price Lowest First</option>
<option value="pricehigh" <?php if ( $_POST["selectboxvalue"]=="pricehigh" ) echo "selected"; ?>>Price Highest First</option>
<option value="datenew" <?php if ( $_POST["selectboxvalue"]=="datenew" ) echo "selected"; ?>>Newest</option>
<option value="dateold" <?php if ( $_POST["selectboxvalue"]=="dateold" ) echo "selected"; ?>>Oldest</option>
</select>
</form></div>
<img src="banner_slim/classique_collection.jpg" width="985" height="290" alt="classique">

</div>

this seems to work in all the browsers I tested. but for some reason is seems dirty to me. I am not sure why.

Also for some reason only top and left work for the positioning. Is there any reason you could think of why right and bottom would not work?

Thanks for any advice.

Stooshie
11-02-2010, 12:33 PM
That looks fine to me but what you could do is separate out the styling from the code itself.



.mystyle
{
position:relative; top: 268px; left:380px; height:0px; width:200px;
}
<div class="mystyle>
.
.
.
</div>


You can even put the css in a different file to make it shareable.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum