Search code examples
cssmedia-queriesresponsiveness

Is it unprofessional to use @media screen in css


I am trying to make my site responsive and was originally planning on using @media screen property in CSS, in order to optimise it for mobile devices.

I'm already using bootstrap but want to modify parts of it (which I have been doing using @media screen) for mobile devices. However, I've been told that this is unprofessional and that I should avoid using this. Is this true?

Thanks


Solution

  • It's hard to fathom why someone would tell you that using @media screen is unprofessional. That's how media queries work for, ya know, screens.

    No, there is absolutely no reason to think that using media queries for screen, print, or speech is unprofessional in any way. It's a necessary tool in your web dev toolkit and you should feel free to use it as intended for your responsive websites.

    See here for Mozilla's documentation for using media queries: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

    UPDATE

    Based on the update to your question (where you added that you are using Bootstrap), I would tend to agree with @aaron-mcguire's answer below.

    As he alluded to, it's impossible to discern exactly the context in which your friend/colleague/person told you it would be unprofessional to use @media screen. But if you're using Bootstrap, it probably makes sense to customize Bootstrap's built-in grid system in order to best meet your layout needs.