Search
 
SCRIPT & CODE EXAMPLE
 

CSS

media query for mobile and tablet

/* Smartphones (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 320px) 
and (max-device-width : 480px) {
  /* Styles */
}

/* Smartphones (landscape) ----------- */
@media only screen 
and (min-width : 321px) {
  /* Styles */
}

/* Smartphones (portrait) ----------- */
@media only screen 
and (max-width : 320px) {
  /* Styles */
}

/* iPads (portrait and landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) {
  /* Styles */
}

/* iPads (landscape) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : landscape) {
  /* Styles */
}

/* iPads (portrait) ----------- */
@media only screen 
and (min-device-width : 768px) 
and (max-device-width : 1024px) 
and (orientation : portrait) {
  /* Styles */
}

/* Desktops and laptops ----------- */
@media only screen 
and (min-width : 1224px) {
  /* Styles */
}

/* Large screens ----------- */
@media only screen 
and (min-width : 1824px) {
  /* Styles */
}

/* iPhone 4 - 5s ----------- */
@media
only screen and (-webkit-min-device-pixel-ratio : 1.5),
only screen and (min-device-pixel-ratio : 1.5) {
  /* Styles */
}

/* iPhone 6 ----------- */
@media
only screen and (max-device-width: 667px) 
only screen and (-webkit-device-pixel-ratio: 2) {
  /* Styles */
}

/* iPhone 6+ ----------- */
@media
only screen and (min-device-width : 414px) 
only screen and (-webkit-device-pixel-ratio: 3) {
  /*** You've spent way too much on a phone ***/
}

/* Samsung Galaxy S7 Edge ----------- */
@media only screen
and (-webkit-min-device-pixel-ratio: 3),
and (min-resolution: 192dpi)and (max-width:640px) {
 /* Styles */
}
Comment

media queries on mobile

@media only screen and (max-width: 600px) {
	...your css here and you're good to go!
}
Comment

css media queries pc and mobile

@media (min-width:320px)  { /* smartphones, iPhone, portrait 480x320 phones */ }
@media (min-width:481px)  { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ }
@media (min-width:641px)  { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ }
@media (min-width:961px)  { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
Comment

media query for mobile landscape only

@media screen and (orientation:landscape) and
(min-device-width: 320px) and (max-device-width: 450px) {
   /* Input Styles */
}
Comment

media query phone

@media (max-width: 640px) {
/* CSS mobile ici */
}
Comment

css media queries mobile first

@media screen  and (min-width:700px) {
    
} //this means the above media queriy will apply if the screen has a minimum screen width
 //of 700px., meaning screens with screen sizes of 700px and above will be affected by the above media query
Comment

mobile first media queries

@media screen and (min-width: 400px)  {...}
@media screen and (min-width: 600px)  {...}
@media screen and (min-width: 1000px) {...}
@media screen and (min-width: 1400px) {...}
Comment

mobile first media queries

/* Default media */
body {
  background: #ddd;
}
/* Media for larger devices */
@media screen and (min-width: 800px) {
  body {
    background-image: url("bg.png") 50% 50% no-repeat;
  }
}
Comment

PREVIOUS NEXT
Code Example
Css :: tailwind backdrop 
Css :: scrollable table vertical 
Css :: center align in grid 
Css :: CS REMOVING BACKGROUND IMAGE 
Css :: css background image position vertical center 
Css :: sticky footer bootstrap 3 
Css :: center align an image css 
Css :: how to use bulma in gatsby 
Css :: tablet screen size css 
Css :: tailwind input field hide arrows 
Css :: how to write text on video in html 
Css :: print media css 
Css :: verticle line css 
Css :: css unlock scroll 
Css :: not(:last-of-type css) 
Css :: hide horizontal scrollbar css 
Css :: css change color 
Css :: what is the username password for ftp lampp 
Css :: have an item span multiple columns css grid 
Css :: scss install 
Css :: text glow 
Css :: ul text decoration css 
Css :: semibold css 
Css :: elementor sticky keep within column 
Css :: centrer verticalement css 
Css :: how to add a class to a paragraph in css 
Css :: css clearfix 
Css :: comments in css 
Css :: line spacing css 
Css :: css make text not break line when overflow 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =