Search code examples
htmlnode.jscsstwitter-bootstrapmedia-queries

Media queries not working properly in nodejs


The media queries of my HTML code works well in desktop. When its integrated with nodejs the media queries not responding properly in desktops. But it works in devices like android and Iphone. I want to fix this because the windows phone not responding to the media queries just like the desktop after nodejs integration.

For example:

@media (max-width: 768px) {
my css code
}

Works in the iphones and androids as expected.But ignored in desktop and windows phones, when used with nodejs.

Can someone please help me with this.


Solution

  • Make sure that when you integrate your stuff into Node, your HTML is still loading the CSS file properly. Node is server-side, media-queries are client-side. The only thing that integration with Node can do is: not serve all the files properly to the client-side.

    Most probably: your client is not loading the CSS file. Check your browser's console and you should see the error message(s).