Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

Using @media only screen query

I want to create a simple webpage . . . a video player (responsive design) placed upon an attractive background image. For mobile devices and smaller screens (tablets) I plan on using a simple solid color or gradient background image. For larger displays, however, (probably 1440w and up) I would like to use an actual, attractive background image. I will then position the player in the lower right or left part of the page - or perhaps centered, depending on the image. My plan is to use the @media only screen query to do this, loading the appropriate bg image per screen size. Can I put all the queries in one external style sheet, and if so, must I list them in any particular order (i.e., smallest width res to the highest)?

Some related questions concerning this project (if you'd be so kind to share advice :) ). Can vector images be used for backgrounds in a web page? Are there any good sources for vector background images on the web? Is there an easier way to accomplish what I've described above? This project is mainly just to share family videos with a wide circle of friends and family. I've thought about just creating 3 separate web pages (small, medium, and large) and letting folks bookmark the one that works best for them based on the device they're using to view the videos. Any thoughts on that?
0
Thunderman54
Asked:
Thunderman54
2 Solutions
 
Julian HansenCommented:
Can I put all the queries in one external style sheet,
Yes
must I list them in any particular order (i.e., smallest width res to the highest)
Smallest to highest is usually conventional for the reason that if you do it another way you will match a potential screen res lower than your max. In CSS last style wins so have the biggest one last to ensure you hit the right resolution for the right browser metrics.
Can vector images be used for backgrounds in a web page?
Check out this link for a discussion on how to do this
http://css-tricks.com/using-svg/
Is there an easier way to accomplish what I've described above?
Sounds like a pretty straight forward site - not sure what you mean by easier. For your background you can either go JPG/PNG which obviously has scaling issues. SVG might have a slightly longer load time (not always though) but scales perfectly.
0
 
GaryCommented:
Smallest to highest is usually conventional for the reason
That will depend on how you are writing your queries.

If you are using the max- directive then you go from highest to smallest
If you are using the min- directive then you go from smallest to highest

If you are using both max- and min- in the same query then it doesn't matter as only one query will (should) ever fire anyway)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now