Free up your time and revolutionize your design with simple web development.

Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs

Posted: February 5th, 2010 | Author: Kurt | Filed under: Web Design | 29 Comments »

Grain, the zen of simple web design, and ways to forget about Photoshop and stop using images.Images increase download time for end-users and workload for web designers, slowing down the time it takes to fully develop a concept for clients. Furthermore, images can add unneeded clutter and increase search-engine blindness, detracting from the principle of simple web design.

You don’t need images to create a deep and beautiful web design. Instead, you can use CSS, typography, and optical effects to do many of the same things and instead only use images when they are clearly needed. If you like these tips, you should check out the bonus tips for five more ways to stop using images in web design.

Before we get started, there is one potential downside to these techniques that needs to be mentioned. Because of the (awful) state of standards-compliant browsers, not all of these ideas will work (or look the same) in all browsers. Therefore, there may be times when you might opt to use an image instead when you want an element to be sure to render the same across all browsers. One way to test browser standards is via the Acid3 test. And, you can see how your design will look in a variety of different browsers with BrowserShots.

Sideways Text

I recently spoke of being creative with text to create typographic contrast. You can rotate text by 90 degrees in order to create a more dramatic appearance, all without resorting to an image. This trick relies on proprietary CSS attributes, so it probably will not be well supported outside of Webkit-, Mozilla-, and Microsoft based browsers.

To do it, add the following code snippet to your stylesheet:

.sideways {
     -webkit-transform: rotate(-90deg);
     -moz-transform: rotate(-90deg);
     filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}

Then, add the style to the element in the usual method:

<h1 class="sideways">CSSrules</h1>

The output should look something like this:

Example of CSS attribute that creates rotated text

Of course, you can rotate text in a variety of different directions and angles by changing the value of the attribute.

Create a Triangle

Believe it or not (and I wouldn’t, if I were you… :-) ), you can create some basic shapes with CSS. Now, you won’t have to use images to include basic symbols within your templates. You can create a triangle by inserting this HTML in the spots where you want the triangle to go:

<div class="upper">
     <div class="inner"></div>
</div>

Now, use the following CSS classes to complete the effect:

.upper {
     position:absolute;
     left:150px; top:100px;
}

.upper div {
     border-left-color: transparent;
     border-style: solid;
}

.inner{
     border-width: 0 0 300px / 200px;
     border-bottom-color: #955;
}

You will get the following:
Create a triangle using only CSS

Automatically Zebra-Stripe a Table

Okay, so I know that this doesn’t quite qualify as a way to replace using images, but it’s such a nifty, simple trick that I couldn’t help but mention it. Using a single selector, you can automatically alternate the appearance of rows in a table. No more having to use PHP or Rails to dynamically insert an “odd” or “even” class to every other table row…

To do this, just start with a basic table. The key thing is to make sure that you wrap the main content of the table in the
tbody
tag. This will make it so that zebra-striping is not applied to the header rows. Here’s the table:

<table border="0">
	<tbody>
		<tr><td>One</td><td>and</td></tr>
		<tr><td>Two</td><td>and</td></tr>
		<tr><td>Three</td><td>and</td></tr>
		<tr><td>Four</td><td>end.</td></tr>
	</tbody>
</table>

And the magical, magical CSS snippet:

tbody tr:nth-child(odd) {
   background-color: #ccc;
}

And that will churn out (something) like this:

Zebra-stripe a table with CSS

Drop Shadows or Glows

You can also avoid using images by using CSS to add a drop shadow or a glow to elements. The following code snippet will apply the shadow to a box element, which is useful for making something stand out on a page. Obviously, you’ll have to play with the effect a little bit to make sure that it doesn’t look too tacky.

.module {
  background-color: #cccccc;
  /* offset left, top, thickness, color with alpha */
  -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
  -moz-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
  box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5);
  /* IE */
  filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=5, Color='gray');
  /* slightly different syntax for IE8 */
  -ms-filter:"progid:DXImageTransform.Microsoft.dropshadow(OffX=5, OffY=5, Color='gray')";
}

Of course, most of these commands are redundant in order to ensure that the browser renders it correctly. Oh, the joy of standards compliance… Here’s what the final effect looks like:
Drop shadows with CSS

Gradients

Here’s a simple trick for gradients:

.gradient {
	background-image: -moz-linear-gradient(top, #aaaaaa, #dddddd);
	background-image: -webkit-gradient(linear, left top, left bottom, from(#aaa), to(#ddd));
	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#aaaaaa,endColorstr=#dddddd);
	-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#aaaaaa,endColorstr=#dddddd)";
}

And it looks like this:

Add a gradient with CSS

Keep in touch with these updates by subscribing to the RSS feed or following me on Twitter.


29 Comments on “Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs”

  1. 1 Items of interest » Blog Archive » Bookmarks for February 5th from 06:19 to 06:19 said at 2:06 am on February 5th, 2010:

    [...] Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs – Cherrysave – [...]

  2. 2 cak said at 3:28 am on February 5th, 2010:

    Curious why you use an image in your document then, or is that just some really fancy css?

  3. 3 Marilyn said at 4:06 am on February 5th, 2010:

    I love the gradient and shadow! Thanks for writing this!

  4. 4 Venkman said at 4:40 am on February 5th, 2010:

    Why use images to show the expected result of using CSS instead of images?

  5. 5 Mitchell said at 7:02 am on February 5th, 2010:

    I find it ironic you propose less images to keep to ’simple’ web design but then go into using proprietary things. Frowny :(

  6. 6 Andreas Becker said at 7:34 am on February 5th, 2010:

    hey, it all sounded nice to me. but after creating a little testcase (xhtml 1.0 trans, inline css) i couldn’t recommend this alternatives.

    i tried the sideways, alternate tablerow and the gradient effects.

    none of them worked on ie6 nor ie8.
    sideways and tablerow worked in ff 3.5.6, gradient not.
    opera 9: no gradient, no sideway, just tablerows.
    chrome: no sideway, gradient and tablerow worked
    safari same as chrome.

    so, for me this is no alternative, cause the “major” browser dosen’t support all the effects.

  7. 7 Chris kemp said at 7:50 am on February 5th, 2010:

    Oh, give the kid a break! We all have lead-ins that could have been better to good articles. The lad’s presented some viable techniques here. Let’s give him a hand!

  8. 8 Flow » Blog Archive » Daily Digest for February 5th - The zeitgeist daily said at 8:39 am on February 5th, 2010:

    [...] Shared Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs. [...]

  9. 9 ml said at 9:15 am on February 5th, 2010:

    It will work in upcoming Opera 10.50, so no worries there.

  10. 10 farid said at 9:32 am on February 5th, 2010:

    realistically this is not practical,
    they render totally different in different browser, some dont even work in IE8,
    as much as everyone likes to slam IE, but if it dont work there, then best bet is to stick to images

  11. 11 Bronwyn said at 9:43 am on February 5th, 2010:

    this article lost all meaning, when I read the title, and then the first thing i see when i get to a page is an image….

    pfft. thanks for treating us all like complete morons. we appreciate it.

  12. 12 Noah Smith said at 10:26 am on February 5th, 2010:

    dont you figure the demographic he is writing to is the one that uses IE7, IE8, maybe even Opera 9… FF3.0?

    In order to communicate at all he is accurate in using images to express himself. He’s just trying to start a trend, and we can give him just that much respect. Maybe a little more if we all realized that Steve Jobs just called the innovation like this the “future”.

  13. 13 nobody said at 11:34 am on February 5th, 2010:

    Most people that comment are really rude all the time. Don’t let it set you back Kurt.

    Good weekend.

  14. 14 Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs – Cherrysave « Bor Rabnud Films said at 7:00 pm on February 5th, 2010:

    [...] via Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs – Cherrysave. [...]

  15. 15 al said at 11:05 pm on February 5th, 2010:

    Thank you. I find these techniques quite interesting. I didn’t know about the gradient thing. Maybe you could have mentioned rounded corners as well, although I’m not sure it works on IE.

  16. 16 Scutigera said at 5:36 am on February 6th, 2010:

    Well, the title is “[...] Stop Using Images in Your Design” not “Stop Using Images”.

  17. 17 digof said at 12:12 pm on February 7th, 2010:

    is it supported in IE?

  18. 18 Francesco said at 12:31 pm on February 7th, 2010:

    Of course these don’t work in IE, why do people are even surprised or bothered by that any more? It’s obvious and well-known.

    But in many (I daresay most) cases they can be used anyway. Sites don’t have to look the same in all browsers, eevn customers are starting to understand that.

  19. 19 Andres Galindo said at 2:13 pm on February 7th, 2010:

    To all the negative comments,

    It is complacency with the lack (to varying degrees) of standards compliance that developers exude that empower Browser Vendors to not strictly follow them (Again, this is to varying degrees. My fingers pointed at Redmond.). Google’s move to drop IE6 support was ballsy and a good sign to vendors: their products are made to serve up websites, websites are not made to acquiesce to the desires of the vendor.

    Anywho, thanks Kurt. These are great alternatives to images that will speed up page loads on some of the more…elaborate designs. It’s important to remember that a good part of the slow down on image heavy websites is not the size of the image itself but the fact that every image is a separate http request.

  20. 20 Bruno Passos said at 5:13 pm on February 7th, 2010:

    I disagree completely! I think images can be used in various ways to make a webpage look nice and smart without delaying the download time.
    As mentioned previously by on of the commentator, the CSS codes you presented here is complex and will make the web developer’s job more complex than it already is.

    On the other hand, I have seen some very useful articles in here and will keep coming back! ;)

  21. 21 Erik said at 5:17 pm on February 7th, 2010:

    I like the tip about the zebra colours for tables. But I do wonder if a gradient image of 1k isn’t faster to load the a css gradient?

  22. 22 Opally said at 5:20 pm on February 7th, 2010:

    It’s a very catchy — but not exactly accurate title — to a very nice post that assembles a bunch of cool CSS effects in the newer and more compliant browsers. The zebra-stripe rows were new to me, thanks! That triangle: mysterious, and interesting.

  23. 23 Erica said at 6:05 pm on February 7th, 2010:

    To everyone complaining about the use of images in this post and the use of “proprietary” or “complex” CSS:

    The CSS properties in the article are part of the new CSS version (CSS3), currently being worked to be released as a standard by the World Wide Web Consortium.

    The properties are not a standard yet, hence the need to specify a “proprietary” prefix. Also, Internet Explorer does not support them yet (surprise surprise), but will have to sometime in the future.

    The use of images in the post is totally understandable, as visitors might be using a browser that does not support CSS3. Not being able to see what CSS3 can do would defeat the purpose of the article, right?

    Also, in defense of the use of CSS, instead of images, this is not just about speed. Being able to write one line of code to create rounded corners is far easier than opening Photoshop/Fireworks, creating the borders, exporting the image, and them embedding it in the CSS. The same for maintenance.

    This is a great post. Nothing that hasn’t been posted before, but brave in proposing the end of images for layout. Well done.

  24. 24 Brian Altenhofel said at 9:59 pm on February 7th, 2010:

    Smart use of images, such as a 1px wide gradient or using CSS sprites, is a much better solution than using proprietary methods. End users expect websites to look and function the same in most modern browsers.

  25. 25 Corinne said at 6:46 am on February 8th, 2010:

    Anyhoe, this gives us just a nice start to work with. If a code is not supported in all browsers, you can experiment further with the code yourselves to make is cross browser. Just try and try a little more instead of just copying the code and complain it does not work…

  26. 26 arvin said at 11:18 am on February 8th, 2010:

    he uses images so IE users can see its effect.

  27. 27 Kawika said at 2:29 am on February 9th, 2010:

    Great post, thanks! I liked the zebra-stripe table thing especially, and plan on using it at the next possible opportunity.

  28. 28 Eclecti.ca » Blog Archive » linkHive For Feb 8th said at 10:50 am on February 9th, 2010:

    [...] Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs – Cherrysave – Images increase download time for end-users and workload for web designers, slowing down the time it takes to fully develop a concept for clients. Furthermore, images can add unneeded clutter and increase search-engine blindness, detracting from the principle of simple web design. [...]

  29. 29 The Ultimate Entrepreneur & Small Business Toolbox | Sean M Everett said at 5:09 pm on March 5th, 2010:

    [...] Forget About Photoshop: 5 More Ways to Stop Using Images in Your Designs - Cherrysave [...]


Leave a Reply