Design comparison
Solution retrospective
Hi there, I’m Sae and this is my solution for this challenge👋
I am strugglig with a media query. I am trying to centre the texts but as there are padding and margin inherited from a desk top version and it won't be centred. Your feedbacks are more than welcome!
Thanks:)
Community feedback
- @abdullah43577Posted over 1 year ago
Hey there, I don't fully understand the issue with the code you said you're having, but I can suggest a fix as I got some key points out from the issue you highlighted, you're trying to center some texts and for some reasons on mobile screen sizes it won't center because of a padding inherited from the desktop screen version?
if this is the issue, using media query could solve this issue, you could just use the media query to remove the padding instead or reduce the padding to achieve what you want and that should work.
let's take this as an example: desktop version:
.container{padding: 5px 16px}
using media query, I can remove the padding from the container element completely or reduce the padding as I'd wanted
@media (max-width:400px) {.container{padding: 2px 4px}}
let me know if this did solve the issue you're having with your code. Happy coding.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord