M
M
mihaguerrero2017-08-19 01:44:36
css
mihaguerrero, 2017-08-19 01:44:36

How to show icon only on small screens?

I understand how noob the question is. There is the usual little "call us" icon. It should be visible only on small screens.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Rustam Bainazarov, 2019-04-18
@urajo

Animation is not needed here + you set the background image only for the :checked state. Accordingly, if it is not there, then the background image is instantly removed, because this is not an animated property in principle (background-image). You need to initially set all the styles, then use the animated properties (opacity, transform).

G
German_Berg, 2019-04-18
@German_Berg

var b=document.getElementById("myimg2");
 
function onMouseIconComm(){
    this.src="img/close_2.png";
}
 
function outMouseIconComm(){
   this.src = "img/close_3.png";
}
 
b.onmouseover=onMouseIconComm;
b.onmouseout=outMouseIconComm;

F
FullStack Alex, 2017-08-19
@FullStackAlex

@media only screen and (min-width:1000px){
        #ikonka{
            display:none;
        }
    }

A
Aligatro, 2017-08-19
@Aligatro

Use media-queries .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question