responsive-design

Why does Twitter Bootstrap Use Pixels for Font Size?

孤者浪人 提交于 2019-12-18 09:57:27
问题 Given that Twitter Bootstrap is designed to be responsive / device-friendly, why doesn't it use relative font sizes? 回答1: Well it seems that they are hiding behind the browser zoom excuse. Really sad to see such a heavily used and influential framework completely ignore accessibility issues and a fundamental cornerstone of responsive design. They are in a position of great responsibility and unfortunately seem to have no intention of acting accordingly. [Update] So today Mark Otto replied on

Is it possible to set a fluid width for Facebook's social plugins?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-18 09:57:08
问题 I'm developing a site around the "responsive design" concept, but the facebook social plugins are static width and "break" the layout when it's re-sized. Using media queries, I've set the plugins to hide on low-res browsers (mobile, etc...). However, on desktop browsers, when the browser window is re-sized smaller, but not so small to hide the plugins, they break out of the layout. Any way to set a fluid width for the Facebook social plugins? 回答1: The correct working answer is a combination

How do I responsively center text inside of a <div>

亡梦爱人 提交于 2019-12-18 09:45:54
问题 I have a <div> that contains three <div> s. In each of those <div> elements is a <p> element with text and 2 nested elements to make a radial progress bar. What I need is to put the text in the middle of the circles, and do it responsively using pure CSS. I need something like this: The code has flaws, like that <p> inside of a <span> but I am fixing it in the new version with the help you guys provide. .radius-container div { -webkit-box-flex: 1; -ms-flex: 1; flex: 1; } .radius-container div

Aspect ratio divs with CSS background images

半世苍凉 提交于 2019-12-18 09:23:40
问题 I have images of equal aspect ratios (300px x 255px) in divs taking up ~31% of the width to make 3 columns on desktop/tablet, then full width on mobile. The images scale to 100% within the div, with the height set as auto. I need to change them from img tags to background images http://codepen.io/anon/pen/yYagJd **HTML:** <div class="hotels"> <img src="http://www.telodesign.com/test/cavallo-300.jpg" alt=""><br> Here's a title </div> <div class="hotels"> <img src="http://www.telodesign.com

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

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

link on certain position of an image background which is responsive

…衆ロ難τιáo~ 提交于 2019-12-18 07:07:42
问题 I've got a task to do and I'm not able to find a solution or direction in which to target. Task This task needs some links positioned in a image full background. This image has some products inside it and the links need to be on top of these products, taking into consideration that the screen can be wider or not so the image background could stretch and therefore the position of the links would also have to adapt. Any idea how to do this? Tryout I tried already the <map> and <area> tags but

How to use srcset and sizes for responsive images

断了今生、忘了曾经 提交于 2019-12-18 05:54:29
问题 I have following snap-points: 480px , 900px , 1800px , 2400px . and this markup: <img sizes="(max-width: 2400px) 100vw, 2400px" srcset=" boat-480.jpg 480w, boat-900.jpg 900w, boat-1800.jpg 1800w, boat-2400.jpg 2400w" src="boat-2400.jpg" alt="This is a boat"> How should I get responsive images to work? 回答1: 1. Basics Device-pixel ratio Device-pixel ratio is the number of device pixels per CSS pixel which is related to: Pixel density of the device (number of physical pixels per inch) Zoom level

Responsive Layout - PX, EM, or %?

纵饮孤独 提交于 2019-12-18 03:17:40
问题 I am building a responsive page layout and it works great so far, but I have a question: Should I be using em, px or %? For example, I want to have border radius applied to an element. Should I use this code: border-radius: 1.563em; Or this: border-radius: 25px; Should I be using ems for similar properties or should I stick with px? 回答1: Generally, don't use px for responsive layouts. If you use a px -based media query, then your layout may end up looking like crap when the user zooms. And

CSS : Is it possible to adapt font size to div width?

此生再无相见时 提交于 2019-12-18 03:04:41
问题 I have a div with 70% width, and here’s what i want to do: put some words in that div adapt font size so that those words occupy all div width Is this possible with only css? Here is my code: .parent { width:70%; height:auto; min-height:100px; background:red; font-size:10vw; } Please help me to change the font-size dynamically to the parent class <hr> <div class="parent"> This Text </div> Note: the div size is responsive , this is important. Thanks in advance! 回答1: Perhaps not quite what you