background preloader

Images

Facebook Twitter

Simple Responsive Images With CSS Background Images. With all the talk of new HTML5 standards such as the srcset attribute and <picture> element, as well as server-side techniques such as Responsive Web Design + Server Side Components (RESS), you'd be forgiven for concluding that simple, static websites can’t support responsive images today. That conclusion might be premature, however. In fact, there's an easy, straightforward way to deliver responsive images that's supported by all of today's Web browsers: CSS background images. However, the approach has some limitations, and it doesn't work in all cases. But if your requirements aren’t complicated, and if you’re willing to make an extra effort to ensure your images are accessible, CSS background images may be all you need. In this article we'll look at the CSS background approach in several steps: Note: This approach requires explicit control of your website's style sheets as well as its HTML markup.

The Need For Responsive Images Identifying The User's Context Overcoming Limitations. CSS Sprites with Background Positioning. There's nothing more common than hover states to give your website some life. The user comes to your site, scrolls over an image with their mouse cursor and the image changes. That's it. While I spent most of 2012 learning backend programming with Ruby on Rails, I’m only recently spending more time improving my frontend development skills. Earlier this week, I needed to implement the hover state effect so I researched what the best practice was. All of the tutorials and tips I could find were unclear, outdated, or plain confusing so I decided I’d write my own. We're currently in development on some new things for Uncover and on one page we have an image that we want to change when a user rolls their mouse cursor over it. Here's the image: When a user rolls over it, we want it to change to this: Let's look at how I implemented this earlier today.

Here's a look at the sprite I created: You can see that I have one image neatly aligned on top of the other. Using SVG. Further reading: Why Aren’t You Using SVG? SVG is an image format for vector graphics. It literally means Scalable Vector Graphics. Basically, what you work with in Adobe Illustrator. You can use SVG on the web pretty easily, but there is plenty you should know.

Why use SVG at all? Small file sizes that compress wellScales to any size without losing clarity (except very tiny)Looks great on retina displaysDesign control like interactivity and filters Getting some SVG to work with Design something in Adobe Illustrator. Notice the artboard is cropped up right agains the edges of the design. You can save the file directly from Adobe Illustrator as an SVG file. As you save it, you'll get another dialog for SVG Options. The interesting part here is that you can either press OK and save the file, or press "SVG Code... " and it will open TextEdit (on a Mac anyway) with the SVG code in it. Both can be useful. Using SVG as an <img> If I save the SVG to a file, I can use it directly in an <img> tag. As CSS. How to: CSS Large Background. Posted at Web Designer Wall Common Mistake: Background Gets Cropped (see demo) Take a look at the demo file, it looks fine under 1280px. But if you have a high resolution display, you will see the background gets cut off on the sides.

Example #1: Single Image A quick solution to fix the problem mentioned earlier: make the edge of the image the same color as the BODY background color. Here, I'm going to use Web Designer Wall as an example. CSS Part The CSS part is very simple. Here is the CSS code: Notice there are two extra lines in the BODY selector. View Demo Example #2: Double Images For this example, I'm going to use the job board design, Design Jobs on the Wall. The trick here is to export the GIF matte with a brown color that is similar to the cork board pattern. View Demo Example #3: Sky Background Using HTML Selector Below is an example of the sky background using HTML selector to display the gradient background, so the #wrapper DIV tag is not required.

View Demo. Fade Out the Bottom of Pages with a Fixed Position Image. Animating CSS3 Image Filters. In recent articles I've shown how to create cross-browser image filter effects with CSS and SVG: converting color photographs to black and white and sepia-tone, as well as blurring them. The next obvious step is to animate these effects. Right now, these effects can be fully transitioned only in the most recent builds of Chrome; other browsers will show a "flick" between two filtered states, with no animation.

As a rule, I don't show web development techniques until they are completely duplicable in at least two different browsers, but in this case, the effects are so neat (and expected to be fully supported in all browser versions so soon) that I'm making an exception. You can see how your browser performs with animated filter effects in the example at the top of this article (a variation on my earlier "Animated Card Fan" effect, with individual transitions on each card when it is hovered over). Greyscale to Color Image Transition To transition this effect smoothly, we must add CSS3. Making a Loading Icon in just CSS!

CSS3 Border-Image Property: Making Photos Really Cool! Posted at Hongkiat by Thoriq Firdaus Creating borders is nothing new in HTML & CSS; we’ve been able to add borders since the beginning. You may have been familiar with solid borders, dotted borders, dashed borders and so on. But, with the new CSS3 border-image property, creating borders on HTML element is becoming more advanced; well, simply put, we are now able to add a border using an image as the source which will allow us to add more attractive borders. All right, now let’s see how this property works: Syntax and browser support The border-image in CSS3 is defined using the following shorthand syntax: The syntax above is the official version from W3C that is only supported in Chrome, while Opera, Firefox and Safari are still requiring the prefixed version (-o-, -moz-, -webkit-), and the Internet Explorer unsurprisingly does not support this property at all. So, in short, for now we can only apply the value of image source, slice and repeat.

Image slice Creating a photo frame The Markup. 25 Beautiful Image Styling Tutorials With CSS,jQuery. Posted at 1st Web Designer by Daniels Mekšs CSS3 rounded image with jQuery Learn to wrap a span tag around the image element to achieve rounded images which will be displayed right in all modern browsers. Multiple backgrounds and borders with CSS 2.1 Learn how to use CSS 2.1 pseudo-elements to provide up to 3 background canvases, 2 fixed-size presentational images, and multiple complex borders for a single HTML element.

Quick tip: multiple borders with simple CSS Quick screencast showing you how to achieve multiple borders with simple CSS that way adding more depth to your designs. Multiple borders on dynamically sized elements with CSS2 Third version of Nicolas Gallagher showing you what to do if you don’t the size of element. Have fun w/ borders – beveled, pressed, & more! Learn how to achieve pressed effect with CSS and some simple border style tricks to get various effects. Polaroids with CSS3 Perfect full page background image CSS3 box shadow and image hover effects Floatutorial PNG overlay.