Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make image disappear with a smaller page size?

I am working on a design for a website and when you decrease the size of the page I want a specific image in the footer to disappear.

Is this even possible?

like image 307
mediaquery Avatar asked Dec 27 '12 17:12

mediaquery


3 Answers

It's not only possible, but fairly simple with media queries:

@media screen and (max-width: 600px) {

    .myImageClass {display:none;}

}
like image 139
adeneo Avatar answered Oct 26 '22 22:10

adeneo


Yes, it is easily doable. I suggest you use CSS media queries to get the job done.

/* Normal CSS rules (always applies) */
#footer { display: none; }

/* Media query rules to override previous rules, as necessary */
@media screen and (min-width: 800px) { 
   #footer { display: block; } 
}
like image 21
Brad Avatar answered Oct 26 '22 22:10

Brad


This can be done either with CSS Media Queries or using Javascript. SmashingMagazine has a good article that can help you get started: http://www.smashingmagazine.com/responsive-web-design-guidelines-tutorials/

like image 26
ama2 Avatar answered Oct 26 '22 22:10

ama2