I am attempting to use display: none so an element will show up on a smaller resolution (or a mobile device) but not on the main css for larger screen sizes.
I think it is probably logical that it doesn’t show but I can’t figure out a way to get around this.
footer {
display: none;
}
@media handheld and (max-width:480px),
screen and (max-device-width: 480px),
screen and (max-width: 600px)
{
footer {
background-color: #colour;
position:fixed;
bottom: 0;
left: 0;
right: 0;
}
}
You can set it to
display:blockwithin your media query, this will override the display:none;Another method would be a jQuery/Javascript solution, potentially something like this:
Notes: This is using the jQuery library which is nice to work with for things such as this, as it easily helps with browser comptability and ease of use.