Within a media query i have set to apply at 400px, i have rules for my Code elements where i want their width to be 100%, unfortunately this is not applying.
Although the margin-left i have set is applying… Not sure why this is not working…
The other issue is that just 1 of my code elements, under the If…else statement article, is having an issue where the code inside is not fitting within the Code element box. Around 456px it stops conforming to the Code element box and just flows out…
This is confusing since every other code inside the other code element boxes are staying within the Code element box.
Thanks again for any help provided. Please let me know if any further information is required.
Keep in mind that code element needs to adhere to the parent elements. It will not necessarily have the actual 100% of the width of the screen, but the space that it’s able within the parent. For example if parent element has set some margin then the actual 100% width of the code element will be limited by that margin.
That’s because those words are without any whitespace and they simply can’t be wrapped around more. There’s few ways to deal with this - changing the text (which is bound to give the same result at some point later anyway), setting some arbitrary min-width to the element, or instead setting any specific value using the fit-content for it.
Yeah sorry my bad x) I forgot to mention the issue occurs during S Mobile mode in chrome… Other than that it appears as wanted. I just like to make it act as much as the example as possible.
What I meant was that there are two @media queries on the page, and while min-width set for the max-width: 400px was preventing the text from flowing out. There was a point when width was slightly bigger than that and text flows out, but rule wasn’t set for that case.