media-queries

Media queries in CSS

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:48:01
问题 I am trying to apply a CSS for tablets. Tablets have larger displays but the pixel density is not as high as on for example the iPhone 4, Samsung Galaxy Nexus etc. <link href="css/mobile-tablet.css" media="all and (min-device-width: 600px)" rel="stylesheet" type="text/css" /> If I do that the smartphones will also get that CSS. Is it possible to do this in another way? I don't know if you can check both the number of pixels and the physical width of the screen in centimeters or if there are

Chrome Developer Tools displaying screen larger than I set in responsive mode

萝らか妹 提交于 2019-12-11 03:27:53
问题 I'm on chrome developer tools and opened the responsive mode. Set the width and height to mobile size (320 x 568, 360 x 640, things like that). Media queries to mobile are not getting loaded. Both jQuery and the size-helper in the chrome dev-tools shows 980px of width, much larger than I set. Extra info: I put my webpage in a deploy server and also used a chrome extension as a emulator because I couldn't trust the Chrome's measures. In the deploy server it somehow works like chrome (so there

How slow are CSS media-queries?

泪湿孤枕 提交于 2019-12-11 03:25:40
问题 When I organize my CSS, I like to keep related styles altogether (header styles are in one section, footer styles are all in the same place, etc.) (sorry, OOCSS advocates). I've recently been experimenting with media queries for smaller/larger screens. To keep with my organizational scheme, I would have to include separate queries for each screen size I'm targeting with each section of the code. (So, for example, if I was supporting, like, seven different screen sizes, I would have seven

Media Query - is height of viewport larger than width?

纵然是瞬间 提交于 2019-12-11 03:18:15
问题 Is it possible using CSS3 media queries to ask: 'is the height of the viewport larger than the width'? or: 'is the width of the viewport larger than the height'? I would like my images to be fluid in both directions! Thanks. 回答1: For this you might use the following media queries: orientation:portrait orientation:landscape I cannot give you more information on the media queries, as I haven't researched them yet. Do make sure they are supported by the devices you wish to support. As for CSS:

jQuery media queries with match media

淺唱寂寞╮ 提交于 2019-12-11 03:16:31
问题 I am trying to change my jQuery code depending on screen resolutions. I am animating main content area, and would like to change it's width on different screen sizes. After a lot of searching online i found something that might be helpful, but i can't get it to work.Here is the code snippet that needs to be changed. It is called Match Media, something like CSS3 media queries, only for JavaScript. var mq = window.matchMedia( "(max-width: 320px)" ); if (mq.matches) { menuLink.click(function(){

How to add specific media query rule when media query combined

﹥>﹥吖頭↗ 提交于 2019-12-11 03:14:24
问题 I have two media query combined like below in my scss file: @media all and (min-width: 600px) and (orientation: portrait), // add css rule to the above media query all and (min-width: 601px) and (max-width: 840px) and (orientation : portrait) { border: 1px solid #red // add specific css rule to current media query only } How would I add a specific rule for each query in that case? 回答1: I am afraid you can't do that. This is one query, with two sets of rules, there is no "current" query. You

customizing bootstrap columns in portrait orientation for mobile devices

孤街浪徒 提交于 2019-12-11 02:46:46
问题 Task: Trying to make a mobile webpage: http://jsfiddle.net/anujbhai/hgaH7/3/ (also include jQuery & Bootstrap files in order to run properly). Problem: Page should change layout according to Orientation - in landscape mode <div id="videoThumbs">...</div> will show 2 thumbnails and snaps beneath the <div id="billboard">...</div> while in the portrait mode the latter goes to the left of the screen and the former now shows only one thumbnail, appearing like a sidebar. This is very hard to do

Responsive site works on desktop but not mobile

早过忘川 提交于 2019-12-11 02:15:39
问题 I'm working on developing this responsive Wordpress site: http://www.allisoncassels.com/Test/ and having a problem with my media queries. I coded the CSS for the following breakpoints: /* Portrait Tablets */ @media only screen and (min-width: 768px) and (max-width: 959px) /* Portrait Mobiles */ @media only screen and (max-width: 767px) /* Landscape Mobiles */ @media only screen and (min-width: 480px) and (max-width: 767px) On desktop, everything looks great. On my phone and tablet, some

PhoneGap css media queries aspect not working

妖精的绣舞 提交于 2019-12-11 01:14:52
问题 I have developed an app with iPhone as design target (i.e. 640x960 => 2:3) and I have done so using percentages for each division in layout so the ui streches itself with respect to device size. Now this works fine with iPad but I am having problems with 9:16 aspect ration devices. I have used Media Queries for the purpose but that isn't working. The default code for division is: .top_bar { height: 9%; } Now using Media Queries aspect ratio: @media screen and (min-device-aspect-ratio: 9/16) {

Outlook 2007/10/13 <style media=“print”> work around

我的梦境 提交于 2019-12-10 22:48:30
问题 I've encountered something that bugged me while testing my email marketing campaigns. So here goes: I use the following code so that images and some other bits won't print when a user prints the e-mail (It is for a hotel group so emails are printed often, with booking numbers and all). <style media="print"> body { background-color:#FFFFFF; } .no-print { display:none; } </style> Now, outlook 2007/10/13, aol mail and some other clients seem to consider themselves as printed media and apply the