media-queries

media query pixel-density and max-width together

牧云@^-^@ 提交于 2019-12-30 09:49:19
问题 I'm trying to create a rule that includes/excludes based on both max-width and device-pixel-ratio. An example would be if I want the Kindle Fire @ 600px to be excluded, but the iPhone5 @640 (smaller real world screen) to be triggered. Does the following make an AND or an OR rule? Assuming it makes an OR rule, how would I create a rule that performs an AND type function (must pass both 'device-pixel-ratio of 2' AND 'max-width 749px' checks to be triggered) @media only screen and (min--moz

What is better: CSS media queries or JQuery mobile?

╄→尐↘猪︶ㄣ 提交于 2019-12-30 07:34:15
问题 I'm newbie for developing mobile website. I very confused between two methods because I dont have any experience this it. Whats more better between two methods: css query when we using all of width device in css file or using jquery mobile that use php technique for differented user that use desktop or mobile [user->php?->mobile use jquery mobile/desktop use css standard]? Many thanks for this answer 回答1: I will classify methods by their importance, from most important one to less important:

Print Stylesheet - Converting inputs to text

懵懂的女人 提交于 2019-12-30 04:16:06
问题 I've got a table that has some <input type="text"> boxes in it, and I want these to show as normal text when printing. I have set up a media="print" stylesheet with input { border-style: none; } in it, and this removes the border so the content just looks like text, but the input is still pushing the width of the column to its actual width (not surprisingly) so I get unnecessary empty space and column widths. Is there a funky way to somehow either set the input's width to its content size

How to detect if Media Queries are present using Modernizr

妖精的绣舞 提交于 2019-12-30 03:49:10
问题 I'm trying to detect whether media queries are present using Modernizr 2, then loading in respond.js if appropriate. I've put this in my script.js file... Modernizr.load({ test: Modernizr.mq, yep : '', nope: 'mylibs/respond.js' }); What am I doing wrong? I'm really surprised there isn't an example of how to do this with Media Queries on the Modernizr site. Here is the version of Modernizr I'm using... http://www.modernizr.com/download/#-backgroundsize-borderradius-boxshadow-iepp-respond-mq

How to figure out proper min-width and max-width values for responsive CSS?

ぃ、小莉子 提交于 2019-12-30 03:31:27
问题 I'm just now diving into responsive CSS and design, and I'm wondering how I'm supposed to figure out various device widths out. I don't want to spend all day testing every single mobile device possible, I just want to get the responsive layout enough to where it works. I saw some sites using @media only screen and (max-device-width: xx) but it seems that limits it to very specific resolutions, not actual browser window sizes. Any advice at all would be great. I'm not new to web development or

Media query ipad vs iphone4

你说的曾经没有我的故事 提交于 2019-12-29 22:07:43
问题 I am using the media query in css to differentiate iphone and ipad Here's my code: /* iphone 3 */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation:portrait) { ... } /* iphone 4 */ @media only screen and (min-device-width : 640px) and (max-device-width : 960px) and (orientation:portrait) { ... } /*iPad styles*/ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:portrait) { ... } /* i have the same

Media query ipad vs iphone4

徘徊边缘 提交于 2019-12-29 22:07:22
问题 I am using the media query in css to differentiate iphone and ipad Here's my code: /* iphone 3 */ @media only screen and (min-device-width : 320px) and (max-device-width : 480px) and (orientation:portrait) { ... } /* iphone 4 */ @media only screen and (min-device-width : 640px) and (max-device-width : 960px) and (orientation:portrait) { ... } /*iPad styles*/ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation:portrait) { ... } /* i have the same

Difference between aspect-ratio and device-aspect-ratio in CSS media queries

旧城冷巷雨未停 提交于 2019-12-29 04:30:11
问题 What is the difference in simple terms between aspect-ratio and device-aspect-ratio ? 回答1: aspect-ratio Describes the aspect ratio of the targeted display area of the output device. This value consists of two positive integers separated by a slash ("/") character. This represents the number of horizontal pixels over the number of vertical pixels. Source. device-aspect-ratio Describes the aspect ratio of the output device. This value consists of two positive integers separated by a slash ("/")

Media queries PX vs EM vs REM

筅森魡賤 提交于 2019-12-29 04:19:29
问题 Can anyone explain why my media queries break when converting them FROM px TO ems In the body of my document, I have included the following rule font-size: 62.5%, Therefore I would assume that I could convert my media query to FROM 650px to 65em? Changing my media queries to ems breaks the layout As an alternative, can I convert the media query to REMS with a pixel fallback ?? that said, I have no idea how to do this @media screen and (min-width: 650px) { body { font-size: 62%; background

Why does media query only work when placed last in my CSS?

久未见 提交于 2019-12-29 01:51:14
问题 I'm learning css and I came across an example that has the following code: <body> <a href="#" class="CardLink CardLink_Hearts">Hearts</a> <a href="#" class="CardLink CardLink_Clubs">Clubs</a> <a href="#" class="CardLink CardLink_Spades">Spades</a> <a href="#" class="CardLink CardLink_Diamonds">Diamonds</a> </body> and css: .CardLink { display: block; color: #666; text-shadow: 0 2px 0 #efefef; text-decoration: none; height: 2.75rem; line-height: 2.75rem; border-bottom: 1px solid #bbb; position