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 trialVoyti 1
1,854 PointsWhat does width: 45%; property do?
Can anyone explain what "width: 45%" does in this case? I tried to change it to smaller and bigger values and it looks exactly the same.
2 Answers
Bassie Bangura
7,630 PointsA 45% width value means that, the element takes up 45% of the width of the entire width available to it's parent element. For example: If a parent element has a width of 100px and the child element has a width of 45%, that means the child element will have a width of 45px. Hope this helps.
Christian Blume
10,424 PointsHello Wojti,
posting your HTML and CSS files would be a great help for us to look into the problem you're mentioning. If the property doesn't have any effect, then there might be something wrong with your code.
Voyti 1
1,854 PointsVoyti 1
1,854 PointsThat's what I was thinking, but navigation looks exactly the same when it's set to 20%, 45% or 90%?