G
G
Grigory Vasilkov2016-02-07 23:09:05
css
Grigory Vasilkov, 2016-02-07 23:09:05

How to return an element to a page without Javascript using CSS?

Is there a cross-browser property for the DISPLAY attribute to return an element to the position it was declared at page start?
***
I use inline-block a lot. Of course, you can hang the .inline-block class that will make the element so, and if you add a second .disable class, then the element will receive display: none;
The question is - when it comes to the following situation:
- by default, the element is hidden
- with a certain media query, the element is shown
- it is not known in advance - this element is a table, block or inline (that is, something like a general .only-desktop class) which can be hung on any element
without creating separately
only-desktop-table
only-desktop-inline
only-desktop....

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zuraavl, 2016-02-07
@gzhegow

i hide with opacity: 0 visibility: hidden, maybe that's what you need
and if you need to hide its height as well, you can add position: absolute

_
_ _, 2016-02-07
@AMar4enko

Invert the logic and instead of showing the element, hide it on the desired media queries.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question