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 trial

CSS Unused CSS Stages Media Queries Device-Specific Media Queries: Part 1

Ji Jiang
Ji Jiang
2,505 Points

Regarding floating an element

Hi, if I set an element's floating property to "left", will the element be taken out of its normal flow and floated to the left of which container? Its parent container or the left of the viewport? Thank you!

2 Answers

Tommy Gebru
Tommy Gebru
30,164 Points

Good Question! The element should float to the "left" of the parent element. A good example of this would be

<p>
<img src="cinnamon.png" >

This is the text of the paragraph element.
</p>

/*Here an image is set within the paragraph and therefore its value if it had a float property would be within or of the given paragraph either "left, right, none or inherit" the value inherit allows for the image, in this case to follow the same rule as the the parent element which would be the paragraph.*/

Ji Jiang
Ji Jiang
2,505 Points

Thank you very much! Very helpful!