Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJuan Luna
11,483 PointsQuestion about Float and Clear property.
Hi, I did the Float exercise in my CSS course but when I tried to do the same a second time something went wrong: the paragraph isn't behind the H4, I tried to use the Clear property but doesn't work; I don't know what is the problem. This is the example:
Thank you all.
3 Answers
Matthew Bryant
5,868 PointsTake out float:left under the H4 tag. I think that might be what you're looking for.
Tim Knight
28,888 PointsJuan,
I'd probably appreciate it a little differently. Since the image and the headline are both floated you're not going to be able to clear: left on paragraph because it'll just appear below the image. Instead float the image and then set a margin-left of a containing div that covers both the headline and the paragraph to a margin of the width of the image plus the padding.
Matthew Bryant
5,868 PointsEverything was set to float left. The "Cro" title was short enough to fit everything on one line. The "Bombay Bicycle Club" title was longer so it broke to the next line. If the Cro title was longer you probably would never have noticed it.
Tim Knight
28,888 PointsTim Knight
28,888 PointsMan, good catch.
Juan Luna
11,483 PointsJuan Luna
11,483 PointsCan you tell me why that fix the problem? Taking out float:left?
Thank you