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 CSS Basics (2014) The Box Model The Box Model Review

Erick Martinez
Erick Martinez
2,894 Points

What type of elements take up the full width available based on the width of their parent element?

It's not telling me the correct answer and I just wanna know for future reference.

2 Answers

Martin Lecke
Martin Lecke
14,385 Points

Hi Block elements takes up full width of their parent elements. eg. <div> You can also make other inline-elements to block elements with css using a property on that selector. Block on Span etc

display: block:

// example
span {
  display: block;
  background: red;
}

check out my example here