Can someone explain to me why this is happening?

Context: I'm performing the challenges, and when I tried to zoom in, I saw this! Problem: I'm confused on why my background color is not taking the whole screen when I minimized it? Could someone explain why this is occurring and how I can solve it? here's my code: https://codepen.io/Mega-123/pen/zYVwbpQ
No description
17 Replies
Chris Bolson
Chris Bolson5mo ago
Your codepen doesn't look like that, at least not in Chrome or Firefox that I have tested. Are you sure that you have copied over all of the code to the codepan?
Shadow_Lurker
Shadow_LurkerOP5mo ago
Yeah, I dropped my entire HTML and CSS project on CodePen, so I'm sure that's all of my code.
Chris Bolson
Chris Bolson5mo ago
And, in the codepen, do you see the same issue as your dev version?
Shadow_Lurker
Shadow_LurkerOP5mo ago
In CodePen, I don't see it, but when I inspect it and zoom in, it happens. I used Visual Studio Code for my HTML and CSS.
C_7
C_75mo ago
this kind of layout is usually found on the web, not on mobile
No description
Jochem
Jochem5mo ago
The mobile view is discussed later on in the course, as far as I can remember also, there's no viewports that are only 125px wide, not anymore
Shadow_Lurker
Shadow_LurkerOP5mo ago
Ooh is that so! Then why is my background color not filling the entire background?
Jochem
Jochem5mo ago
I can't reproduce that at all, so I don't know you haven't verified your email in codepen, so I can't look at the pen in full screen view. codepen's own interface has a minimum width, so I can't get it unreasonably small like you have here
Jochem
Jochem5mo ago
this is as small as it gets, and it works fine:
No description
Jochem
Jochem5mo ago
320px is also a totally reasonable lower limit in 2024
Shadow_Lurker
Shadow_LurkerOP5mo ago
Oh, so that's how CodePen works! And thanks for answering my question.
Jochem
Jochem5mo ago
well, codepen restricts the full view without its own interface (so the boxes to enter the code) to accounts that have verified their email. That means that there's some limitations to how small you can make the viewport, as codepen itself sets the minimum width to 320px and just accepts scrolling below that. if your issue occurs above 320px, you either didn't use the latest version of the code you're looking at for the codepen (or didn't save it), or you're doing something else on top of setting the responsive viewport to an unreasonably small size either way, as long as the site works on reasonable desktop sizes, CRL will get into mediaqueries and small screens later on in the course so just keep going (also, questions about CRL should go in #conquering-responsive-layout, and not in #front-end)
snxxwyy
snxxwyy5mo ago
Try removing initial-scale from the viewport meta tag. Replace <meta name="viewport" content="width=device-width, initial-scale=1"> with <meta name="viewport" content="width=device-width">
Shadow_Lurker
Shadow_LurkerOP5mo ago
it didn't work I figure it out already, I just need to remove my <meta name="viewport" content="width=device-width, initial-scale=1>
ἔρως
ἔρως5mo ago
no, thats horrible! the problem is that the text is too big for the viewport it's overflowing
Shadow_Lurker
Shadow_LurkerOP5mo ago
@ἔρως your right thx for that!
ἔρως
ἔρως5mo ago
you're welcome
Want results from more Discord servers?
Add your server