0

I'm running into some issues with HTML / CSS. I want to float a number off divs after each other. But the last div in line doesn't float how I want it. It's a litte difficult to explain so I placed my code on JSFiddle:

In basic, my HTML looks like this:

<ul>
  <li>
    <div class="product-image"></div>
    <div class="product-title"></div>
    <div class="product-description"></div>
    <div class="product-spec"></div>
    <div class="product-offer"></div>
  </li>
</ul>

Full example including CSS: http://jsfiddle.net/6r46B/

Below an image with these div's and how I want them to align: enter image description here

The issue here is that the div .product-offer is floating right of the div .product-spec. But I want it all the way up. How would I do that?

PS: This part will be used in a responsive design. This will be the wide example.

3
  • To start with there is no such element as link that can be used in the body and you have random tags and closing tags in your HTML. In fact your structure is pretty weird as it is. Commented Apr 29, 2014 at 15:54
  • 1
    Have your floated elements first: jsfiddle.net/oGeez/6r46B/1 Commented Apr 29, 2014 at 15:55
  • @Paulie_D, the weird things you see are I think the schema.org microdata. I might not have worked that out perfectly. However, thats not the point! Commented Apr 29, 2014 at 16:27

1 Answer 1

3

Make product-offer the first element in the order of your DIVs to take precedence in the float-order.

Sign up to request clarification or add additional context in comments.

1 Comment

Great! So simple, I just didn't see it! Thanks! Now I can try making it responsive!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.