It's possible that the CSS rules are not declared in the correct order, and without any provided code, it's difficult to pinpoint the issue.
To make a small adjustment, try adding
@media only screen and (max-width: 768px)
. Take a look at the following code example below and the JS Fiddle link provided - resize the browser window to see the CSS rules take effect.
<div id="myElement">
<p>
hello
</p>
</div>
--
#myElement {
display: none;
}
@media only screen and (max-width: 768px) {
body {
background-color: lightblue;
}
#myElement {
display: block;
}
}
Check out the JS Fiddle demo here: https://jsfiddle.net/1dqxkgyt/3/