Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

What are the CSS media queries?

What are CSS Media Queries, and how to implement them

user-image
Question ajoutée par Fadi Alkhateeb , Senior Front End Developer , NexTwo
Date de publication: 2013/09/13
Utilisateur supprimé
par Utilisateur supprimé

Best site to know about this. Checkout http://mediaqueri.es

Mohammad Ateieh
par Mohammad Ateieh , Software Engineering Manager , Bayt.com

 is a CSS3 module allowing content rendering to adapt to conditions such as screen resolution (e.g. smartphone vs. high definition screen) , it giving you the ability to create an iPhone version of your website as an example . 

So you can build multiple css file for different windows sizes , so you can define css for800px window size or css sheet for1024 window size :

@media only screen and (max-device-width:480px) {

div#wrapper {

width:400px;

}

 

div#header {

background-image: url(media-queries-phone.jpg);

height:93px;

position: relative;

  }

}

 

so this code will only take effects in480px devices , this link may help

http://mobile.smashingmagazine.com/2010/07/19/how-to-use-css3-media-queries-to-create-a-mobile-version-of-your-website/

Mohamed Asfer Rafiudeen
par Mohamed Asfer Rafiudeen , Software Engineer , Web Gurus International Private Limited

A media query consists of a media type and at least one expression that limits the style sheets' scope by using media features, such as width, height, and color. Media queries, added in CSS3, let the presentation of content be tailored to a specific range of output devices without having to change the content itself. (source https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

 

Simply we can use this to apply diffrent CSS styles to different devices(PC, Smart Phone, Tablet).

 

@media (max-width:600px) { .facet_sidebar { display: none;

}

source (https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries)  

Besim Dauti
par Besim Dauti , Ceo / Front End Developer , Nunforest

css media queries help you to do your webpage responsive for all devices

Utilisateur supprimé
par Utilisateur supprimé

Basm allah alrahman alrahim

 

 

don't forget to use

 

<metaname="viewport"content="width=device-width, initial-scale=1.0"> at your html file  , @media is the best thing that will happens to any website responsive designer if he understand it will , and it can help you to change your layout from device to another device not only stretch and compress

 

viewport was not perfect, but a quick fix

More Questions Like This