Majin Brian
Majin Brian

Reputation: 39

How to start new section below a floating element

<div style="background-color:black; margin-top:0px">
    <a href="http://csc2.madonna.edu/~brabahy/hw5/mercury2.html"><img src="http://csc2.madonna.edu/~brabahy/hw5/images/Mercury1.jpg" style="float:left; margin-right:10px" height="400" width="400"></a>
    <p style="color:brown">Mercury is the smallest planet, and it's closest to the Sun of the eight planets in the Solar System. It has an orbital period of about 88 Earth days.</p>
</div>

I am trying to start a new element (another div containing a floating image and text - identical to the existing img and text) below the floating image, rather than to the right of the image. However I can't figure out what to do!

Upvotes: 0

Views: 49

Answers (1)

Spade
Spade

Reputation: 591

You need to add the clear: left; css style to the second div. Some more info on how Clear works is available here: https://developer.mozilla.org/en-US/docs/Web/CSS/clear

http://codepen.io/anon/pen/YXYgKo

Upvotes: 1

Related Questions