I have multiple elements with different types of display like .inlineBlock{display:inline-block}
or .flex{display:flex}
etc. and I have used them like below:
<div class="inlineBlock desktopOnly"></div>
<div class="inlineBlock mobileOnly"></div>
<div class="flex desktopOnly"></div>
<div class="flex mobileOnly"></div>
Some elements should be only visible on desktop and some should be visible just in small screens. So I have defined two media rules:
@media all and (max-width:768px){
.desktopOnly{
display:none;
}
.mobileOnly{
display: what??????
}
}
@media all and (min-width:768px){
.mobileOnly{
display:none;
}
.desktopOnly{
display: what??????
}
}
As you see I don't know how to recover the original display type if element so It fallback to its original display type when media changes? Do I need to redefine any class one-by-one in media rules? is there a general way to handle all elements at once (preferably a CSS only solution)?