I have just completed the Tribute Page challenge in Codepen.
Run the tests, it shows all are passed. But I have another annoying problem. The thumbnails of my tribute page don’t look any good in Codepen .
I suspect that the screenshot you took is of the page itself. I looked at it in debug and full page modes, and it looks fine.
But my problem is that in the thumbnail on Codepen the preview of my page is distorted (like in the screenshot that I posted). So I was thinking what I did wrong and why my page’s preview looks wonky.
The thumbnail view forces the site (viewport) to a narrow width (like a mobile screen). You may need to add a media query to make the green container wider , and the “Bart Simpson” heading font size smaller, when the screen size is less than say 500px.
One more thing i wanted to add was, in codepen, or when you use a separate CSS file, you need not add tags. These are needed only if you add CSS code within the HTML file itself.
Thank you so much !
I put in the @media query, but it seems that it does nothing to the thumbnail… it stays the same (distorted)…
Just to be on the same page, can you share a link of the page where you are viewing the thumbnail? I will be happy to check it by tomorrow if not tonight (since its getting a bit late here :-))
As regards the tags, do you mean in CSS in particular, and in HTML ?
I meant the <script> tag within the CSS box in Codepen. They are not needed.
The solution is to use relative units that change according to the screen size.
I personally prefer to use percentage.
Here’s how to make your page flexible & responsive (or at least make it better):
Delete that media query at the beginning (there’s no need for it at the moment)
Search for #main and then delete margin: 50px 200px; . #main will expand on the entire space. don’t worry, There’s an alternative to margin and it’s better.
Add to #main the width of 60% (adjust it if you’d like) and also add margin: auto to center it! The CSS to add is: width: 60%; margin:auto;
If you resize the screen now, you’ll see that it’s got better! Now, do the same thing with #tribute-info, delete margin margin: 0px 80px;, then add to it width: 80%; margin: auto;
If you resize the screen, you’ll see that your design is getting better and better, now all is needed is fixing the title! Add a media query at the end of your CSS because if you don’t, it will not work. it works only when added at the end of the style or at least after the element in question. So, add the following:
@media only screen and (max-width: 600px) {
#title {
font-size: 50px;
}
}
@media only screen and (max-width: 390px) {
#title {
font-size: 30px;
}
}