Best Practices for Structuring Your Web Content

33
Best Practices for Structuring Your Web Content Ben MacNeill, User Interface Designer eXtension

description

We'll introduce the idea of the three parts of the modern web page structure - content, presentation and behavior - and focus on how to improve the structure of the content. We focus on the content structure because everything else will get stripped away as your content moves across the web. When your page is accessed by mobile devices, feeds and search engines all that matters is your writing and the html markup. Make them count.

Transcript of Best Practices for Structuring Your Web Content

Page 1: Best Practices for Structuring Your  Web Content

Best Practices for Structuring Your Web Content

Ben MacNeill, User Interface Designer

eXtension

Page 2: Best Practices for Structuring Your  Web Content

Why worry about page structure?

• It’s not just a web page anymore

• Your content is going to be interpreted by a variety of clients, scripts and devices

• You need to wrap up the content in a meaningful way

Page 3: Best Practices for Structuring Your  Web Content

How do You Structure Web Content?

• Use meaningful markup

• Establish a structural hierarchy

• Remember simple accessibility guidelines

• Don’t worry about appearances

Page 4: Best Practices for Structuring Your  Web Content

Anatomy of a web page

Content

Structure

Semantic markup

Presentation

Cascading Style Sheets (CSS)

Behavior

Javascript, Animations

Page 5: Best Practices for Structuring Your  Web Content

Anatomy of a web page

Content

Structure

Semantic markup

Presentation

Cascading Style Sheets (CSS)

Behavior

Javascript, Animations

Page 6: Best Practices for Structuring Your  Web Content

Assume the design is going to get stripped away

All that’s left for the reader is your writing and markup

Rule of Thumb

Page 7: Best Practices for Structuring Your  Web Content

Content viewed as a web page

Page 8: Best Practices for Structuring Your  Web Content

Same Page, No Styles

Page 9: Best Practices for Structuring Your  Web Content

Side-by-side Comparison

Styled for aweb page

Un-styled(only content + markup)

Page 10: Best Practices for Structuring Your  Web Content

Semantic Markup

• HTML elements are the building blocks of web documents: <h1>, <p>, <li>, <a>

• These elements have meaning

• Convey meaning to their contents

Page 11: Best Practices for Structuring Your  Web Content

Looks nice, but what’s under the hood?

Meaningful Meaningless

Page 12: Best Practices for Structuring Your  Web Content

<h2>What is eXtension?

</h2>

<span class="subhead">What is eXtension?

</span>

Meaningful vs. Meaningless Markup

Meaningful (Semantic)

No Structure,No Meaning

Page 13: Best Practices for Structuring Your  Web Content

A wiki markup example

== What is eXtension == '''What is eXtension'''

Header element Bold

Page 14: Best Practices for Structuring Your  Web Content

Good markup is easy

• if it’s a heading, use a heading element <h1> or == ==

• if it’s a list, use a list element <ul><li>item or *item

• if you want to give something emphasis, use <strong> or '''item'''

Page 15: Best Practices for Structuring Your  Web Content

Avoid misusing markup - definition lists

• Just another kind of HTML list

• wiki markup for a <dl> is a colon :

• looks like you are simply indenting, but actually wrapping it in special list markup

Page 16: Best Practices for Structuring Your  Web Content

Avoid misusing markup - tables

• Tables should only be used for tabular data. Never for layout.

• Can severely impair readability on mobile devices.

• Interferes with screen readers.

Page 17: Best Practices for Structuring Your  Web Content

Why separate content and presentation?

• It's not 1999

• All the CSS is in one place.Global design changes are easy.

• Your content is more portable forfeed readers, mobile, printing

• Biggest offenders: <font>, <table> and inline styles <p style="color: red;">

Page 18: Best Practices for Structuring Your  Web Content

Page Hierarchy

• Create visual order on the page with markup

• Readers don’t read, they scan

• Headlines and subheads are anchors

Page 19: Best Practices for Structuring Your  Web Content

The F Pattern

source: Jakob Nielsenwww.useit.com/eyetracking/

article/blog product search results

Page 20: Best Practices for Structuring Your  Web Content

Hierarchy content tips

• Descriptive, meaningful accurate page titles are essential

• First two paragraphs need to contain the most important information

Page 21: Best Practices for Structuring Your  Web Content

Navigation

• 80%+ of users come from search

• Treat each piece of content as a standalone page

• Don’t add custom nav schemes

• A series? Link to the series summary.

• Related articles? Contextual links in body of the text. (both add Google juice)

Page 22: Best Practices for Structuring Your  Web Content

Contextual Navigation

Page 23: Best Practices for Structuring Your  Web Content

If you need navigation

Put it after your content

Otherwise, it will show up at the top of mobile devices, feed readers, search engines, screen readers

Page 24: Best Practices for Structuring Your  Web Content

Accessibility

• Semantic markup makes your content very accessible.

• Lists and headers are very helpful

• Additional items:

- link text and titles ("click here" is not descriptive)

- image alt texts (searchable by Google)

Page 25: Best Practices for Structuring Your  Web Content

Portable (extensible)

• You don't know where a reader is going to see your content

• Feed readers

• Mobile devices

• Search results

• Even Printing (old-school)

Page 26: Best Practices for Structuring Your  Web Content

What you want your reader to see

What your reader wants to see

Feed Readers

Page 27: Best Practices for Structuring Your  Web Content

Content on Mobile DevicesA web page on a mobile device

The same page optimized for a mobile screen

Page 28: Best Practices for Structuring Your  Web Content

Search Engine Results

Page 29: Best Practices for Structuring Your  Web Content

Printing

Page 30: Best Practices for Structuring Your  Web Content

Readability

• Simple issues to keep in mind

• Don't make paragraphs too long - keep them scannable

• Your page title shows up in search results. Make it descriptive and accurate.

Page 31: Best Practices for Structuring Your  Web Content

Recap• Semantic markup

• Avoid misusing markup

• Establishing page hierarchy

• Content based links over navigation

• Accessibility

• Markup makes it portable

Page 32: Best Practices for Structuring Your  Web Content

Big Benefits

• Accessible

• Portable(can be viewed in any format)

• Discoverable(good writing combined with good markup increases Google juice)

Page 33: Best Practices for Structuring Your  Web Content

I Love Markup

• Please contact me if you have any questions

• Ben MacNeill, [email protected]