Designing with Structural Thinking

In the old days, many of us learned to make web pages by first thinking about the “look” and what images, fonts, color schemes, and graphic design elements we would use to achieve it. We launched Photoshop or Fireworks and played with the look until we knew precisely (down to the pixel) what the page would look like. Once we had that plan, we began trying to make HTML create a pixel perfect rendering of the design.

If you want your HTML page to be web standards compliant and accessible you need to back off from thinking about “the look” first and begin your process by thinking about the semantic meaning and structure of the content your page will hold.

The look doesn’t matter

Before you faint and fall out of your chair over that statement, let me explain. A well-structured HTML page can look like absolutely anything. The CSS Zen Garden revolutionized web design by proving that a page of HTML can be made to look like absolutely anything. The CSS Zen Garden helped us finally get it: there is power in CSS that can be used to create any presentation whatsoever out of a simple page of HTML.

HTML is not just for the computer monitor anymore. That wonderful look you created in Photoshop or Fireworks might not work at all on a cell phone, or an aural screen reader. But a well-structured HTML page can go anywhere, work on any internet capable device, and be styled in a manner appropriate to the device with a CSS stylesheet.

Start Your Thinking

The starting point is structural. Some writers call it semantic. What those terms mean is that you need to think of your content as blocks of related meaning, or more simply, as content blocks. Think about the purpose your various content blocks will serve. Then design a semantic HTML structure that supports the meaning and purpose of your content.

If you sat down and planned out the structural bits and pieces you wanted on a web page, you might come up with a list like this.

  1. heading with logo and site name
  2. main page content
  3. global site navigation
  4. subsection navigation
  5. search form
  6. utility area with shopping cart and check out
  7. footer with legal stuff

The generic element used to provide structural context to a page of HTML is the div element. (That’s assuming you aren’t experimenting with HTML5, which has elements fitting many of these structures built in.) Using the div element with assigned ids for the structural parts of the page, your major structural content blocks could be:

<div id="header"></div>
<div id="content"></div>
<div id="globalnav"></div>
<div id="subnav"></div>
<div id="search"></div>
<div id="shop"></div>
<div id="footer"></div>

It isn’t a layout; it’s a structure. It’s the organization of information into content blocks. Once you understand what your structure needs to be, adding the appropriate content in the appropriate divisions of the page becomes automatic.

A div can contain anything, even another div. Your major content blocks will contain the HTML elements you need to create your page–headings, paragraphs, images, forms, lists, and so on.

By thinking first in terms of content, you now have structural HTML elements that can be positioned and styled in any place on the page and in any way you want. Each of those content blocks in your HTML can be individually placed on the page, and assigned colors, fonts, margins, backgrounds, padding, or alignment rules.

This information was rewritten from an earlier much longer article published at the Wise-Women.org site called The Early Bird Catches the CSS: Planning Structural HTML.

Site Testing Checklist

It’s wise to test your site as you’re building it. Check your pages for accessibility, for validity, for appearance and function as you go along. Don’t wait until you’re finished to think about things like valid code and accessibility.

Even when you do those things as a normal part of your process, you still need to perform a number of tests after the files are uploaded to a live server. Here’s a brief checklist of things you need to test when your site goes live.

  • Validate HTML and CSS
  • Run accessibility checks
  • Check every function and script
  • Check spelling and grammar
  • Check page appearance in a variety of browsers
  • Evaluate the site with CSS disabled
  • Evaluate search engine friendliness

    Useful Links: Soma FontFriend, accessibility, high tech movies

    In case you haven’t already picked this bookmarklet up from Zeldman’s blog, here’s Soma FontFriend. “This is a bookmarklet made for web designers who want to rapidly check how different fonts and font styles look on their screen without editing code and refreshing pages.”

    Keeping an aging population online looks at accessible forms.

    It seems problem for society is that an aging population means the cost of ensuring the well-being of the elderly population goes up, but if those aging individuals are able to maintain their independence for longer, say, by leveraging the Internet, those costs could be alleviated.

    When you think about it like that, the importance of web accessibility for the elderly begins to sound quite urgent.

    Are you rushing to see Avatar? The theater in my town was crammed with people this weekend. Michael Arrington said, “Movies will never be the same after Avatar. Like the iPhone in the mobile world, this movie disrupts an entire industry.” What do you think?

    Useful Links: Social media your presentations, Design with intent, future ed, accessibility in business

    We’re all presenters–in the classroom, at conferences, among your colleagues. Here are 9 Tips for Enriching Your Presentations with Social Media. One of the tips in the article is about the backchannel, a topic I’m interested in and have talked about here and here and from SXSWi and again here as well as at BlogHer. Plus, I just reviewed an excellent book called The Backchannel: How Audiences are Using Twitter and Social Media and Changing Presentations Forever.

    Design with Intent talks about how designers can influence behavior—and why they should. It’s one of the most interesting articles I’ve read in a long time.

    Persuasion design embeds various forms of influence and “choice architectures” in products and services to maximize the likelihood of positive behavior change. It has been popularized by economists like Richard Thaler through books like Nudge and services like Mint and stickK.com, which provide countless examples of subtle cues that lead to major shifts in behavior.

    The reason this notion of persuasion design tugs at me is that I can see it applied in so many ways to create positive changes in behavior around all sorts of topics. The article is by Robert Fabricant of frog design.

    21 Things That Will Become Obsolete in Education by 2020 at TeachPaperless takes a look at where tech in education is taking us and makes bold predictions. Standardized test makers may not like what TeachPaperless has to say, but I think this idealized version of the future makes a lot of sense.

    Resources for Developing a Web Accessibility Business Case for Your Organization from the W3C is a good resource for anyone trying to convince a client about the need for accessibility and for anyone teaching a class in accessibility on the web.

    Style Fieldsets like a Pro

    Just a few CSS rules can make your fieldset look like it was styled by a pro. A fieldset is used to organize forms into sections that can be identified with labels called legends. We’re going to start this discussion looking at a fieldset with no legend. We’ll get to legends in a bit.

    Here’s a fieldset with no styling as displayed in the Firefox browser.

    unstyled fieldset in Firefox

    The default Firefox fieldset is a gray border around the enclosed form fields. I’ll start with the border. This rule will change the make it solid, 2 pixels in width, and a dark blue.

    fieldset {
    border: 2px solid #00F;
    }

    This changes the appearance:fieldset with a blue 2px border

    Any border width, style or color could be used. Next, I’ll round the corners. Use the border-radius property for that.

    fieldset {
    border: 2px solid #00F;
    border-radius: 8px;
    }

    In Firefox, you now see this.

    the fieldset with rounded corners

    I want to change the alignment in the form. That has nothing to do with the fieldset, but it will look better if the fields align. This is the rule added.

    label {
    padding: 3px;
    display: block;
    }

    The new appearance.

    the form with some style added to the labels

    Many rules can be applied to the label element. Color, font, and other aspects of the label appearance can be styled.

    There are still many things that can be styled about the fieldset. Width, background-color, background-image and others. Here’s the fieldset with a gradient background image added to the fieldset rule.

    fieldset {
    border: 2px solid #00F;
    border-radius: 8px;
    background: url(fieldsetbg.jpg) no-repeat left top;
    }

    The effect is this.

    the fieldset with a background image

    What about legends?

    Web Teacher reviewed Fancy Form Design a few days ago. One of the things I learned in that fine little book is that screen readers such as JAWS announce the fieldset legend anew for each new field in the fieldset. The example in Fancy Form Design uses a fieldset with the legend “Change Password” and fields labeled “Current Password” and “New Password.” The authors pointed out that hearing the screen reader say “Change Password” before each of the form labels can be quite a lot of listening to the word “password.” As the authors also pointed out, not every screen reader even announces the legend at all.

    Before I explain the solution from Fancy Form Design, here’s how the fieldset would look with an unstyled legend added.

    the fieldset with a legend

    So you’ll see what some of the possibilities are with styling a legend, I’ll show you a legend with the following rule applied.

    legend {
    font-weight: bold;
    font-size: 1.5em;
    color: #03F;
    border: 1px solid #03F;
    padding: 5px;
    }

    Here’s how it looks.

    the fieldset legend with CSS styles added

    Much more can be done to the legend with CSS. For example, the corners could be rounded, the background could be styled, the font could be changed, and so on.

    For this example form, I don’t think it would be too much for a screen reader to announce, “Your contact information, full name” followed by “Your contact information, email,” and “Your contact information, telephone.” I might decide to use the legend here.

    In Fancy Form Design, the authors suggest using a heading before the fieldset, rather than using a legend in the fieldset. With a heading rather than a legend, the screen reader would read the heading just once. Visually, it still makes sense. Here it is with an unstyled h3 element.

    the fieldset with a heading

    My advice is to decide whether or not a legend makes sense on a case-by-case basis.

    Conclusion

    You can style a fieldset like a pro when you realize that everything you know about CSS can be applied to the elements, classes and ids that exist as hooks for CSS rules within the HTML used to construct the form. Everything you know about styling fonts, colors, backgrounds, borders, padding, margin, width, display, and other CSS properties can be applied to styling fieldsets.

    See also:

    Review: Handcrafted CSS


    get this book at amazon.com

    A review by Web Teacher of
    Handcrafted CSS: More Bulletproof Web Design, Video Edition (includes Handcrafted CSS book and Handcrafted CSS: Bulletproof Essentials DVD)

    (rating: 5 stars)

    Handcrafted CSS: More Bulletproof Web Design by Dan Cederholm with Ethan Marcotte is from New Riders (2010). It’s a beautiful book designed by Cederholm himself. Most of it was written by Cederholm. Marcotte contriubuted one chapter called “The Fluid Grid”.

    Cederholm’s trademark style is to examine every angle of a problem—such as the way to display a menu with an item and a price or the way to create rounded corners. After looking at the various options, he selects the one he considers the most bulletproof and recommends it for use.  To be bulletproof, a design solution must be flexible enough to work in many browsers (or at least not differ beyond use in some browsers), be functional with various levels of zoom, be accessible, and be workable in terms of future upkeep.

    Many of the techniques in the book use CSS3. There’s also some jQuery in the mix. No HTML5, though he does suggest it’s the next big thing.

    He concentrates on a few “crafty” CSS techniques in the slender volume. This book is not a complete guide to CSS. It deals with selected design problems. The specific topics getting the Cederholm treatment in this book:

    • his flexible approach to problem solving with CSS
    • rounded corners and background clipping
    • text-shadow
    • RGBA and opacity, with several lovely design tricks well explained
    • his progressive enhancement philosophy aimed at better browsers and letting go of pixel perfect sameness in lesser browser
    • modular float management, a very cool idea for dealing with float problems
    • fluid designs with percentages and ems, even fluid media sizing (this is Ethan’s chapter)
    • typography and @font-face
    • select jQuery enhancements

    Well written and clear to implement ideas are what you’ll find in this book. You need to know HTML and CSS before you dig in.

    Summary: A select set of CSS improvements for designers.

    Technorati Tags: ,

    Review: Fancy Form Design

    A review by Web Teacher of

    (rating: 5 stars)

    Fancy Form Design by Jina Bolton, Tim Connell and Derek Featherstone is from Sitepoint Book (2009). This is really an excellent little book. It gives you tips on planning and designing a form that is both attractive and usable. It provides information on structuring the form using standards-based HTML. Both usability and accessibility features are built into the form structure as a matter of practice in this book. You’d hardly expect less with authors of the caliber of the three who worked on the book.

    Since this book is just about one thing, forms, you learn some things you might not learn in a book that treated forms as a small part of a larger whole. For example, there is an interesting discussion about when to use legends with fieldsets, and when you’d be better off not using legends. You learn about the types of error messages that are most useful in form design. The fine points of labels are discussed.

    In the chapter on styling the form with CSS, there are some excellent tips for form design. Everything from ideas for styling with icons, sprites, and styling widgets is included in the CSS chapter.

    The final chapter takes you through some JavaScript enhancements that will improve your form without making it inaccessible.

    The book reads fast, the code examples are right there and are clearly explained.

    Summary: A must-have book for the form designer.

    Technorati Tags: ,