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: Adaptive Layouts With Media Queries Video--using percentage values for columns

In the video Adaptive Layouts with Media Queries, the widths for the columns Main and Secondary are assigned very specific percentages for their widths for tablet size screens and I'm wondering why those specific numbers were chosen (for example why wasn't the margin-left set at 2% and the other columns just 2/3 and 1/3 of the remaining 98% (65.3333333333333333 and 32.6666666666666667)

These are the values given in the video: [ @media only screen and (min-width: 481px) { .col { float: left; } .main { width: 65.957446808511%; } .secondary { width: 31.914893617021%; margin-left: 2.127659574468% } }]

1 Answer

giselle gonzalez
giselle gonzalez
10,903 Points

do not worry about those percentages as accurate, sometimes teachers do this, is they way to work, it doesn't mean it should be your way to work when working with media query values ​​are given in percent for when changing screen size the page will fit. try this 66% width and 32%, with 2% margin-left. Really nothing changes

@media only screen and (min-width: 481px) { .col { float: left; } .main { width: 66%; } .secondary { width: 32%; margin-left: 2% } }]