SitePoint Design View March 9th 2005 
Issue 7 

Newsletter Archives | Advertising | Contact us  
The Useful, the Usable and the Unbelieveable in Design for the Web 

In This Issue...

Web CEO: Get 10 Free Must-Have Tools for Your Site

WebCEO logoHow many tools do you use to manage and track your search engine listings, analyze your traffic and find out the ROI on your ad campaigns? If it's more than one, get Web CEO and...


  • Find out who is linking to your competition

  • Research keywords and optimize your pages

  • Submit your pages to the major search engines

  • Find and fix problems such as broken links

  • Track and analyze your traffic with 120+ types of reports

Best of all, the free edition of Web CEO is not time-limited, crippled and there's no forms to fill out!


Click here to find out more

Top


Introduction

Alex WalkerWelcome to Design View #7.

I like March. After the meanderings of January and February, everybody seems to hit their stride again in March.

And so it has been at SitePoint where we've welcomed six new contributors to the SitePoint blogging space. If you haven't caught up with them --

1. Stuart Langridge is sharing our CSS/DHTML blog with Simon. Stuart is long renowned for his DOM-centric work on Kryogenix.org and has just completed our forth-coming 'DHTML Utopia' book. There are probably not more than a handful of guys anywhere that know this subject matter better than these two. Keep a close eye on their stuff.

2. Dan Thies has started up a new offering - SitePoint's first search engine marketing blog called Key Words. While not strictly design advice, Dan has much to say about the structure and markup of your front-end code, and how that impacts SEO performance. In short, if you write any HTML, this is likely important stuff for you.

3. And lastly for the more technically-minded among you, our PHP blog is now being shared in-house by our four SitePoint coders - Thomas Rutter, Julian Szemere, Lachlan Donald and Lucas Chan.

That one could get quite snipey and competitive.

Fingers crossed, anyway.

Alex Walker,
Editor
design@sitepoint.com

Top


Creating Creativity

How do you measure creativity?

You can use benchmarking and load testing to judge the efficiency and structure of coding. Usability testing can evaluate the success of information achitecture and interface design. However, when it comes to decisions like color, pattern, gradient and font, it's more difficult to settle on 'carved-in-granite' rules. In fact, many of the most famous designers in history got that way by deliberately breaking what were seen, at the time, as unbreakable design rules.

So if you can't measure raw creativity, how can you learn it? Hugh Macleod from gapingvoid.com has some pearls of wisdom to get you thinking -- 30 in fact.

The four that resonated the most with me were:

  • Put the hours in. Doing anything worthwhile takes forever. 90% of what separates successful people and failed people is time, effort and stamina.
  • Don't try to stand out from the crowd; avoid crowds altogether. There's no point trying to do the same thing as 250,000 other young hopefuls, waiting for a miracle.
  • The best way to get approval is not to need it. This is equally true in art and business.
  • The hardest part of being creative is getting used to it. If you have the creative urge, it isn't going to go away. But sometimes it takes a while before you accept the fact.

Hugh is speaking from his perspective as an illustrator/creative director but these tips (not to mention the 26 others) apply equally to web design. Consider printing this out for re-reading on those tough days.

Drawn.ca

Our other cool recent find is the amazing 'Drawn.ca' -- a multi-poster, blog showcasing illustrators, cartoonists and other assorted doodlers from around the globe.

Drawn.ca only sprang to life in early March but it has already got me hooked. Check it out when you get a chance.

Read the blog entry:

Alex Walker Design Blog: Pixel Perfect
by Alex Walker
Hung, Drawn and Quoted

Top


DOM Text Shadows (*Experiment)

Everybody loves a neat visual effect. The harder bit is making it easy to implement.

A few weeks ago I stumbled across this page and it got me thinking. While I was quietly impressed with the look of the heading text, the markup is not exactly pretty and there is really no viable way to roll this effect out across a whole site.

Current Markup

<div id="cast">CAST<span class="of">of</span> </div>
<div id="castb">CAST<span class="of">of</span> </div>
<div id="castc">CAST<span class="of">of</span> </div>

<div id="shadows"> SHADOWS </div>
<div id="shadowsb"> SHADOWS </div>
<div id="shadowsc"> SHADOWS </div>

Certainly not breathtakingly elegant.

Of course, there are a plethora of shadow effects available via CSS (or CSS-like entities). In fact, Neil Crosby has done a great job documenting the current state of play on his blog. The problem is consistency. One of the things I liked about the 'Cast of Shadows' effect was that it rendered in the same way across all modern browsers.

The following method is a DOM experiment at this stage. Note: It does have accessibility issues that I haven't been able to squash (yet, anyway). However, it might at least give you some ideas for solving other problems in the future.

Text Shadows using the DOM & CSS

My goal here was to try to get the same visual effect without the nasty markup. I'm going to cheat and show the final result so you know where we're heading.

Shadow experiment thumbnail

The core idea is to send a simple H1, and then let the browser build up the shadow -- if it can. Simple non-JavaScript devices will leave the header untouched.

Once the structure is in place, we can use CSS to target, position and color each layer.

The HTML

First, let's hone down the HTML. We can't get any more succinct than:

<h1>..The Shadow Knows!!!</h1>

The JavaScript

I've decided not to get into a blow-by-blow breakdown of the JavaScript in this newsletter and instead talk in broad terms about what the script does. If you're interested though, the source code is very well-commented.

The script will:

  1. Create a new function called funkyshadow()
  2. Find each instance of a H1 on the page and copy it to our 'working' array for later use.
  3. Start a new loop to work through our array of H1s
  4. Each time it finds one, it will created two new 'virtual' H1s (called 'outerh1' and 'middleh1')
  5. It will then replace the original H1 with 'outerh1'
  6. Next it will nest 'middleh1' inside 'outerh1, and, in turn, nest our original H1 inside that.
  7. Finally the outer H1 needs to be made 'shadow colored' -- it's dark by default.

If everything has gone to plan, the browser should have taken our plain, old H1, and reconstructed it to appear like this:

A diagram showing the nested H1s structure

Of course, if you wanted to target H2s, H3s or even P tags, you would only need to make minor changes to this script.

The CSS

Now we have the right structure in place, let's have a look at the CSS. Although we don't have ids or classes to use, we can still target each H1 separately by using 'descendant selector' notation. Although all three headings match the simple h1{}rule, the more precise h1 h1{} and even more precise h1 h1 h1{} will always overrule the simpler rule in a showdown.

We're going to position the outermost H1 relatively, and then position the two inner H1s as 'absolute', allowing us to offset them against the outer H1. Here's the code.

h1{
color:#990000;
font:bold 60px/50px Georgia,Sans-Serif;
letter-spacing:1.2px;
position:relative;
padding:0;
margin:0;
width:480px;
}

h1 h1{
position:absolute;
top:-2px;
left:1px;
color: #F1F1D5;
}

h1 h1 h1{
position:absolute;
top:-1px;
left:1px;
color:#990000;
}

So, there you have it. Adjusting the top and left will give you complete control over the positioning of the shadow. Fonts and colors choices are no different to standard CSS selection criteria. I've used three layers here, but there's nothing stopping you using more or less.

The advantages are mainly consistency and flexibility. Any device that reads HTML and understands JavaScript can render the effect. Non-JS devices are never aware it even exists.

The key disadvantage is an accessibility issue. Most screen readers rely on Internet Explorer's rendering engine to interpret what they will read back to the user. Since IE will render this effect before Jaws reads it out, we have the problem of Jaws reading out two extra copies of our heading. I imagine this could get irritating quite quickly.

Hey, I never said it was perfect ;)

As I said, it's an experiment, but if you have a workaround in mind, I'd love to hear it.

Meanwhile, Stuart has been taking us on a tour of some of Stu Nicholls' more mind-boggling CSS experiments. Although there are some comments on 'inappropriate use of CSS', I tend to think 'out-there' stuff like this is valuable on two levels.

Firstly, it can be a great education aid. Taking a normal behaviour (for instance, ':hover') out of its conventional setting is often a great way of getting a clearer understanding of exactly how it works.

Secondly, it isn't always possible to envisage the final commercial application of a technique until after the pure R&D lab work has been completed. Often it's a case of "Y'know what that thing you invented would be really great for?!"

You never know when the next failed hearing-aid experiment ends up giving you the telephone.

Read the blog entry:

Stuart Langridge Design Blog: Stylish Scripting
by Stuart Langridge

The power of pure CSS (16 comments)

Top


That's all for this issue -- thanks for reading! I'll see you in a few weeks.

Alex Walker
design@sitepoint.com
Editor, The SitePoint Design View

Top


Help Your Friends Out

People you care about can benefit from the wealth of information on new and maturing technologies available on the Internet. Help them learn how to do it by forwarding them this issue of the SitePoint Design View!

Send this to a friend

Download sample chapters free from every SitePoint Book!


cover shotBuild Your Own Database Driven Website Using PHP and MySQL
by Kevin Yank


cover shotThe CSS Anthology: 101 Essential Tips, Tricks & Hacks
by Rachel Andrew


cover shotThe Flash Anthology: Cool Effects & Practical ActionScript
by Steve Grosvenor


cover shotThe Web Design Business Kit
Brendon Sinclair


cover shotHTML Utopia: Designing Without Tables Using CSS
by Dan Shafer

!More information about SitePoint Books

 What's New on SitePoint!

Why Consistency is Critical

Gerry
Gaffney
By Gerry Gaffney

Consistency is the cornerstone of a positive user experience. But consistency means more than simply putting your nav at the top left, your search on the right. Gerry explores consistency, explaining what it is, why it's important, and the areas where consistency counts.

Contractor or Scapegoat? Keys to Successful Contracting

Georgina Laidlaw
By Georgina Laidlaw

The contractor is *not* always to blame for project failure, despite what the project manager may say. Georgina looks at why the contractor is the perfect scapegoat - and what they can do to protect themselves.

Alter Table Row Background Colors Using JavaScript

Kennet Svanberg
By Kennet Svanberg

Manipulate the CSS properties in your HTML documents using JavaScript -- it's an easy way to gain greater contol over your layouts and improve the usability of your content. Kennet explains, altering colors to differentiate the rows in a data table.

 Hot Forum Topics
 New Blog Entries

Design Blog:
Pixel Perfect

Search Engine Marketing Blog:
Key Words

DHTML & CSS Blog:
Stylish Scripting

Manage Your Subscription Here.

!You are currently subscribed as to the HTML edition of the Design View.


CHANGE your email address here

UNSUBSCRIBE from the Design View here.

SUBSCRIBE to the Design View here.

SWAP to the 'Text-Only' version of the Design View here.


SitePoint Pty. Ltd.
424 Smith St
Collingwood, VIC 3066
AUSTRALIA


SitePoint is Hosted by
Ventures Online


Thanks for reading!

 © SitePoint 1998-2005. All Rights Reserved.

Back to the archives

Newsletter signup

Design, coding, community or marketing? Select the right newsletters right for your needs...