media-queries

Respond.js not working cross domain

和自甴很熟 提交于 2019-12-19 02:47:32
问题 I'm having difficulty getting Respond's CDN/X-Domain Setup working. I started off serving all assets from the CDN: <link rel="stylesheet" href="http://cdn.example.com/css/main.css?2013012401"> <script src="http://cdn.example.com/js/modernizr-2.6.2.min.js?2013012401"></script> <script src="http://cdn.example.com/js/respond.min.js?2013012401"></script> In theory this should work, since all assets are being served from the same domain. However IE8 didn't receive Media Query support like it

Is Firefox 6/7 handling max-width:320px media query wrong?

别等时光非礼了梦想. 提交于 2019-12-18 17:06:20
问题 I'm seeing strange behavior with media query in Firefox lately, and I was wondering who's doing it right (compared to Chrome and IE9). I've got the following css: @media screen and (max-width:320px){ #sfWrapper{max-width:280px;font-size:0.625em;line-height:1.2em} #cpw_banner{display:none;visibility:hidden;} #cpw_content{width:100%;}#cpw_aside{width:100%;} } And Firefox (when resizing the browser, doesn't seem to notice the max:width 320px while it reacts to the bigger screen media queries.

how to specify a different image in css depending if the user visits on a desktop or a mobile browser

北城余情 提交于 2019-12-18 13:15:16
问题 Just a question about css for mobile devices, i have an image that is 1260px wide on my website and when i look at it on the phone it destorts the website as the rest of the website is based on a 960px layout. I have made these images to be now 960px wide for the mobile device but how do i specify in css that if it is a mobile use mobile optimized image instead of the one on the regular website. So basically if a user goes on the website on a desktop computer it will show the 1260px image and

Is there a way to use DPI in css media queries instead of px

孤街醉人 提交于 2019-12-18 11:49:54
问题 Number of pixels width and height does not always tell the whole story. That works great for adding or removing items from the screen, but isn't quite right for setting the right image. With the retina display on the MBP, a browser window set to half of the screen would have the same number of pixels in width as most machines today. Yet, images displayed would likely be too small given the higher DPI. Is there a way to change out images based on DPI rather than the number of pixels width and

Responsive design - Media Query not working on iPhone?

一世执手 提交于 2019-12-18 11:09:17
问题 I am trying to create a mobile friendly version of my website, to make my website responsive to a smaller screen size and scale accordingly. I've created some media queries, that behave correctly in a browser when resizing on a desktop. On my iPhone, safari just shrinks the entire website but still maintains the aspect ratio of the full sized site. How do I get the media query to be observed? have I missed something? Here is a link to a sandbox which I am trying to get working correctly - any

LESS CSS retina media queries without redundancy

懵懂的女人 提交于 2019-12-18 09:47:43
问题 I am using a component-based CSS style, so I have been using mixins to allow me to use media queries without accidentally compiling hundreds of them. This is what I am doing for screen sizes: Main file: .mq-medium() {} @import //other files @media only screen and (min-width: 600px) { .mq-medium; } Another file: .mq-medium() { .banner { width: 50%; } } This can be used several times and results in grouped queries. The Problem I am trying to do the same thing for retina background-image queries

How to horizontally scroll the contents in mobile/tablet view in html/css?

那年仲夏 提交于 2019-12-18 09:01:14
问题 I have a fiddle which I have replicated by seeing the screenshot below: The CSS code which I have used for the individual square box item is: .product-contents .product { width: 10%; text-align: center; height: 150px; padding-top: 1%; padding-left: 1%; padding-right: 1%; border-style: solid; border-width: 3px; border-color: rgb(145, 147, 150); background-color: white; border-radius: 10px } Problem Statement: Now in the mobile view, I want the items in the screenshot to horizontally scroll in

Angular.js data-bind background images using media queries

爷,独闯天下 提交于 2019-12-18 08:50:15
问题 I have an Angular.js application with dynamically background images (should have data-binding for their URL). I also want to use css media queries in order to detect orientation/pixel density etc. The only solution I found is using javascript to add URL to the background image, something like this: myDiv.css({'background' : 'url('+ scope.objectData.poster +') no-repeat', 'background-size':'auto 100%'}); This way I have to pass all media queries logic to javascript, something like this. (My

How to load different css file depending on window width: smaller size not recognized

余生颓废 提交于 2019-12-18 07:46:41
问题 I want to load a different css file if the window size is below 500px. I have <link type="text/css" media='(max-width: 500px)' rel="stylesheet" href="/static/mobile.css" /> <link type="text/css" media='(min-width: 500px)' rel='stylesheet' href='/static/main.css' /> But the main.css always overrides the mobile.css despite the window being less than 500px. What's wrong? EDIT: I changed it to <link type="text/css" rel="stylesheet" href="/static/main.css" /> <link type="text/css" media="(max

CSS media query not working in IE 9

瘦欲@ 提交于 2019-12-18 07:45:39
问题 I have included some media queries in my design to change the width of some elements of the page based on the browser's width. The queries look like this: @media screen and (min-width:1024px) @media screen and (max-width:1024px) Chrome, Safari and Firefox work great, only IE is a problem. I know that all versions prior to IE 9 don't support this feature, but they don't work in IE 9 at all. What might be the problem? 回答1: Do you have compatibility mode turned on? 回答2: Make sure you have right