Problem with Imgage not filling in space is caused by padding
So I am struggling with this problem and I believe it has something to do with the
<picture></picture>
element because without it there is no problem. Still, I am using this element because I want the image to change to another at different screen sizes. I have tried a lot of solutions and can't figure it out any help would be highly appreciated ❤️
5 Replies
can you put this on code pen? images also.
Try this
- The
<source>
elements should be ordered from the most specific to the least specific. In this case, the desktop image should be listed first because it applies to a broader range of screen sizes (601px and up).
- The mobile image should be listed second, targeting screens with a maximum width of 600px.
2. Media Queries:
- The media query for the desktop image should start at 601px to avoid overlap with the mobile query. This ensures that there is no ambiguity when the screen width is exactly 600px.I figured out the issue after over 1 hour of pulling my hair out, turns out I was targeting the wrong selector, I was using the correct properties but on the wrong selector then went down a rabbit hole and it was something so simple. I have made the change you have suggested, Thank you so much for responding ❤️ p.s how does your code snippet have color and mine doesnt?
Next time i will use code pen probably for the best as you can see whats happening more 😄
Are you using your dev tools? That’s usually where I start to see if my properties are crossed out, if I’ve made a typo , if they are even being applied to the selector etc.
As for the code blocks you out in the three backticks and then after the third one put the language
Or ```css
And start your code on the line undeneath then of course close the block with the three backticks
Yeah always, problem was I was looking for a problem to much and similar selector names just needed to get away for abit get some fresh eyes