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
hakan Gülay
8,489 Pointsabout code
I couldnt understand ther code which is in video at 3.10. in nav element we used float:right and text-align:right what are difference between them ? and width:45% what it does ? i just tried to understand and ı used width:5% and ı couldnt see different betweent 45 and 5. can u please explain ?
1 Answer
Ricky Catron
13,023 Pointsfloat:right;
"floats" the element it is attached to over to the right side of the page (or of its parent element)
text-align:right;
shifts the text to the right side of its parent element
width:45%;
should make whatever element you are working on have a width that is 45% of its parent element. If it looks the same as 5% there is probably an error in the code or its parent does not have a declared width.
If you have anymore questions feel free to ask!