Align to the right

Discussion in 'HTML & Website Design' started by Rub3X, Jan 23, 2011.

  1. #1
    Can anyone help me align those two boxes so that they're next to each other? Float right just makes it go to the right and not up and to the right for some reason. Site here

    Thanks
     
    Rub3X, Jan 23, 2011 IP
  2. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Markup has to be fixed. It should be something like this on a browser

    
    <div class="content"> <div style="float: left;"> [COLOR="red"]<-- First image and price and button inside a div with float left [/COLOR]
    
    <a class="image" title="1g MDPV" href="http://researchchemicalsupplier.com/salts/mdpv/1g"><img width="186" height="186" alt="1g MDPV" src="http://researchchemicalsupplier.com/media/catalog/product/cache/1/small_image/186x/9df78eab33525d08d6e5fb8d27136e95/p/r/product_image_2.png"></a> <h4><a title="1g MDPV" href="http://researchchemicalsupplier.com/salts/mdpv/1g">1g MDPV</a></h4> <div class="price-box"> <span id="product-price-90" class="regular-price"> <span class="price">$44.97</span> </span> <div class="clear"></div> </div> <button onclick="setLocation('http://researchchemicalsupplier.com/checkout/cart/add/uenc/aHR0cDovL3Jlc2VhcmNoY2hlbWljYWxzdXBwbGllci5jb20vc2FsdHMvbWRwdj9fX19TSUQ9VQ,,/product/90/')" title="Add to Cart" type="button">Add to Cart</button> </div> 
    
    <div style="">[COLOR="red"] <-- 2nd div with image etc[/COLOR] 
    <a href="http://researchchemicalsupplier.com/salts/mdpv/2g" title="2g MDPV" class="image"><img width="186" height="186" src="http://researchchemicalsupplier.com/media/catalog/product/cache/1/small_image/186x/9df78eab33525d08d6e5fb8d27136e95/p/r/product_image_32.png" alt="2g MDPV"></a> <h4><a href="http://researchchemicalsupplier.com/salts/mdpv/2g" title="2g MDPV">2g MDPV</a></h4> <div class="price-box"> <span class="regular-price" id="product-price-91"> <span class="price">$89.97</span> </span> </div> <button type="button" title="Add to Cart" onclick="setLocation('http://researchchemicalsupplier.com/checkout/cart/add/uenc/aHR0cDovL3Jlc2VhcmNoY2hlbWljYWxzdXBwbGllci5jb20vc2FsdHMvbWRwdj9fX19TSUQ9VQ,,/product/91/')">Add to Cart</button> </div> <div class="clear"></div> </div> 
    
    
    
    Code (markup):
     
    radiant_luv, Jan 23, 2011 IP
  3. Rub3X

    Rub3X Well-Known Member

    Messages:
    1,902
    Likes Received:
    75
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Thanks a lot, that worked.
     
    Rub3X, Jan 23, 2011 IP
  4. Dodger

    Dodger Peon

    Messages:
    1,494
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Better yet, you already have a class defined in your stylesheet for aligning. You can go with a DIV without the inline style such as:

    
    <div class="alignleft">
       ... your block of content here ...
    </div>
    
    Code (markup):
     
    Dodger, Jan 23, 2011 IP