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 trialerdragerdragsson
Courses Plus Student 5,887 PointsSomething is wrong with my navigation when resizing browser
here are the images of the website behaviour
scroll down to see all images.
and here is the code for my media query
gallery li:nth-child(2n+1) {
clear:left; } @media screen and (min-width: 480px) {
/**************************************** TWO COLUMN LAYOUT *****************************************/
#primary { width: 50%; float: left; }
#secondary { width: 40%; float: right; }
/**************************************** PAGE: PORTFOLIO *****************************************/
#gallery li { width: 28.3333%; }
#gallery li:nth-child(2n+1) { clear: none;
}
#gallery li:nth-child(3n+1) { clear:left; }
/****************************************
PAGE: ABOUT
*****************************************/
.profile-photo { float: left; margin: 0 5% 80px 0; }
}
@media screen and (min-width: 660px) {
/****************************************
HEADER
*****************************************/
nav {
display: inline-block;
background: none;
float: right;
font-size: 1.125em;
margin-right: 5%;
text-align: right;
width: 45%;
}
#logo {
float: left;
margin-left: 5%;
text-align: left;
width: 45%;
}
h1 {
font-size: 2.5em;
}
h2 {
font-size: 0.825em;
margin-bottom: 20px;
}
header {
border-bottom: 10px solid #599a68;
margin-bottom: 65px;
}
Just tell me if you need the codes for my "main.css" or "index.html"
2 Answers
jaredcowan
11,808 PointsA quick and easy way is to just add white-space: no wrap;
nav {
display: inline-block;
background: none;
float: right;
font-size: 1.125em;
margin-right: 5%;
text-align: right;
width: 45%;
white-space: nowrap;
}
erdragerdragsson
Courses Plus Student 5,887 PointsJust saw that when i added the nowrap to the nav selector, now my head border, is cut off at the "other link"
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 Pointsnow i got rid of the problem when the browser is half size,
but the links still wraps around when the browser is the smallest
i tried to add a white-space: nowrap inside the other media query but it didnt help any ideas?