简体   繁体   中英

Css Media Queries Resolution Issue

I was wondering how I can use CSS Media Queries to detect screen resolution and make a different page load if the screen resolution is under 1024x768? I also need to know if I can place this query in my master.css script? or where it would need to be placed?

Sitemap (without Java included)

  • Index.html (Main Page)
  • About.html (About Page)
  • Missing.html (404)
  • Small.html (the smaller version I am trying to get to load)
  • ie8.css (conditional css for internet explorer 8)
  • Master.css (Main Stylesheet)

You can serve up different styles to a page based on the width of the browser viewport in various ways, such as this:

@media only screen and (max-width: 1024px) {
  your styles here
}

You can put that anywhere in your style sheets.

Be aware, though, that you can't use media queries like this to load a different page . For that, you'd need some kind of device detection script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM