Combining CSS media queries

Separate them with a comma: @media only print, only screen and (max-device-width: 480px) See the spec, in particular, example VI (emphasis added): Several media queries can be combined in a media query list. A comma-separated list of media queries. If one or more of the media queries in the comma-separated list are true, the whole … Read more

How to control number of items per row using media queries in Flexbox?

I had to get rid of the margin around the blocks, because percentage widths are difficult to cleanly apply to elements with margins, but you can see the changes at http://codepen.io/anon/pen/jPeLYb?editors=110 : @mixin max-width($width) { @media screen and (max-width: $width) { @content; } } .container { position: relative; display: flex; flex-flow: row wrap; } .item … Read more

How to target iPhone 3GS AND iPhone 4 in one media query?

Because the iPhone and iPod touch measure max-device-width in logical pixels rather than physical pixels even with the Retina display (as they should), the original media query used for the iPhone should be enough: @media only screen and (max-device-width: 480px) { /* iPhone CSS rules here */ } You’ll only need (-webkit-min-device-pixel-ratio: 2) if you … Read more

Fixed background image with ios7

Using background-attachment: fixed with background-size: cover causes issues on most mobile browsers (as you’ve seen). You can try using background-attachment: scroll. This won’t give your desired effect, but you’ll see the images at least. You could use a media-query or two to limit it to devices that are tablets or phones by using @media screen … Read more

How to code CSS media queries targeting ALL mobile devices and tablets?

This can be done with Level 4 Media Queries: (Browser Support is quite good – CaniUse) Interaction Media Features The idea here is to target devices based on their capabilities. (as apposed to say, checking the size or resolution of the device which tend to be moving targets) The pointer media feature queries the quality … Read more

CSS media queries and jQuery window .width() do not match

You’re correct about the scroll bar, it’s because the CSS is using the device width, but the JS is using the document width. What you need to do is measure the viewport width in your JS code instead of using the jQuery width function. This code is from http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/ function viewport() { var e = … Read more

Twitter Bootstrap Responsive layout does not work in IE8 or lower

If you want to have better performance and your structure is not too complicated. You can try Respond.JS From the author: This isn’t the only CSS3 Media Query polyfill script out there; but it damn well may be the fastest. If you’re looking for more robust CSS3 Media Query support, you might check out http://code.google.com/p/css3-mediaqueries-js/. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)