background preloader

Scottjehl/picturefill

Scottjehl/picturefill

How to use src.sencha.io This Guide is most relevant to Sencha Touch, 1.x. Sencha.io Src helps you dynamically resize images for the ever increasing number of mobile screen sizes. We’ve previously done a lot of work in Sencha Touch to make your UI resolution independent, and Src expands this to include your image assets. It’s easy to use, and in this guide, we run through the main API options for the service. Sencha.io Src is essentially a proxy that lies between image assets (hosted either on your own server or by a third party) and the browser or application requesting them via HTTP. The API is accessed entirely via placing a prefix before the original image URL. Let's start with a quick example. To use Sencha.io Src in its default mode, you simply prefix your absolute src attribute with Add that into the tag and your image will be magically resized for a smaller, mobile screen: In this particular case, the image is of landscape orientation, and so width becomes the constraining dimension.

Aspects & Reference (speaker website) Brakeman - Rails Security Scanner » Responsive IMGs Part 2 — In-depth Look at Techniques Cloud Four Blog Responsive IMGs Part 2 — In-depth Look at Techniques In Responsive IMGs Part 1, I took a high-level look at what responsive IMGs are, the problem they are trying to solve, and the common issues they face. In this post, I’m going to take a deeper look at the specific techniques being used to provide responsive IMGs and try to evaluate what works and doesn’t. When I started working on this project two months ago, I thought I would get to the end and be able to say, “Here are the three approaches that work best. What I’ve found is that there is no comprehensive solution. Because of this, the best thing we can do is understand the common elements and challenges so that we can start to pick the best parts of each for building our own solutions. So um… this is a long post. Abandoned approaches Dynamic Base Tag Many of the early techniques used javascript to dynamically change the base tag. Unfortunately, this approach ran into race conditions that I described in part 1. Temporary images 1. 2. 3.

Designing CSS Layouts With Flexbox Is As Easy As Pie Advertisement This article is an updated excerpt of the chapter “Restyle, Recode, Reimagine With CSS3″ from our Smashing Book #3, written by Lea Verou and David Storey. — Ed. Flexible box layout (or flexbox) is a new box model optimized for UI layout. As one of the first CSS modules designed for actual layout (floats were really meant mostly for things such as wrapping text around images), it makes a lot of tasks much easier, or even possible at all. Flexbox’s repertoire includes the simple centering of elements (both horizontally and vertically), the expansion and contraction of elements to fill available space, and source-code independent layout, among others abilities. Flexbox has lived a storied existence. There are, however, some caveats. When you specify that an element will use the flexbox model, its children are laid out along either the horizontal or vertical axis, depending on the direction specified. Example: Horizontal And Vertical Centering (Or The Holy Grail Of Web Design) <!

Vertically Center Multi-Lined Text If you only have a single word or a single line of text, there is a clever way to vertically center it in a block with CSS. You set the line-height of that text to be equal to the height of the box. Works great, but is a major fail if that text needs to wrap. A "speech bubble" is a classic example of somewhere we might want text to be centered both horizontally and vertically and be adaptable to multiple lines. View Demo Download Files The HTML is nothing fancy. <div class="area"><div class="bubble"><p>To look best, text should really be centered inside this bubble both vertically and horizontally. The "bubble" we'll set to display: table;, which really doesn't do much by itself, but then we can set the <p> element inside to be a table-cell, which allows us to use the vertical-align property on it. Does the trick beautifully I think. What about IE <= 7 ?! IE 8 is supporting CSS tables, but IE 7 and below do not. ... could be worse. First wrap the inside <p> in a new <div> and then: Share On

» Responsive IMGs — Part 1 Cloud Four Blog In my post “Where are the Mobile First Responsive Web Designs”, I noted that one of the first things I look for when trying to determine whether or not a responsive web design is “mobile first” is whether or not it has a strategy for handling the IMG tag. A recent Smashing Magazine round up of responsive web design techniques included several new approaches for handling IMG tags which makes it the perfect time to dig into this problem and the potential solutions in more depth. Why IMG Tags Suck for Responsive Web Design If you want your site to load as quickly as possible, you do not want to deliver larger files than are needed. Many responsive web design sites provide mobile devices images at sizes appropriate for desktop and ask the mobile device to resize the image. In my research, I found nearly 80% decrease in file size by delivering images at the actual size they were going to be used on a mobile device. So what’s the problem with the IMG element in responsive designs?

html5shiv - HTML5 IE enabling script Dual licensed under the MIT or GPL Version 2 licenses Full original, uncompressed source available here: Source code adds new HTML5 elements (which is simple code), but also supports printing HTML5 elements and includes the default styles for HTML5 elements, like block on article and section. Getting it to work in the browser was easy, @jon_neal and afarkas made IE actually print HTML5 elements - these guys are to take all the credit. To use this script, download the html5shiv and roll it in to your own code (ideally minified). Common question: what's the difference between the html5shim and the html5shiv?

#130 Monitoring with God Need to ensure your background processes stay up and running and don't use too many resources? Check out the god gem as shown in this episode. Download: source codeProject Files in Zip (121 KB)mp4Full Size H.264 Video (27.9 MB)m4vSmaller H.264 Video (16.9 MB)webmFull Size VP8 Video (42.3 MB)ogvFull Size Theora Video (38.9 MB) johnkoht/responsive-images Box Sizing The "box model" in CSS works like this: width + padding + border = actual visible/rendered width of box height + padding + border = actual visible/rendered height of box It's a little weird, but you get used to it. In IE 6 and earlier, when in "quirks mode," the box model was treated differently. width = actual visible/rendered width of box height = actual visible/rendered height of box The border and padding values moved inward, cutting into the width/height of the box rather than expanding it. It was weird quirk to have to deal with, although the fix was usually as easy as setting a proper DOCTYPE and getting out of quirks mode. The mind bending continues with the modern implementation. If you wanted to ensure the box kissed the edges of the parent, but still use a 100% width declaration, you'd have to set the child divs width to 476px. This <div> pseudo markup only takes us so far, because the answer of course is to not use a 100% width declaration. I would love a different box model!

Related: