Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2009
    Thanked 1 Time in 1 Post

    is this not proper?

    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>
     <img src="banner_slim/classique_collection.jpg" width="985" height="290" alt="classique">
    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.

  • #2
    Regular Coder Stooshie's Avatar
    Join Date
    Mar 2008
    Dundee, Scotland
    Thanked 39 Times in 39 Posts
    That looks fine to me but what you could do is separate out the styling from the code itself.

    	position:relative; top: 268px; left:380px;  height:0px; width:200px;
    <div class="mystyle>
    You can even put the css in a different file to make it shareable.
    Regards, Stooshie


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts