90 likes | 205 Views
Semantic Markup and Search Engine Optimization. Joseph R. Lewis Sandia National Laboratories. Doing Justice. What do we do with all that great content work? Treat markup with care Think accessibility Represent your document in markup as the spec intended Use HTML 4.01, XHTML, XML
E N D
Semantic Markup and Search Engine Optimization Joseph R. Lewis Sandia National Laboratories
Doing Justice • What do we do with all that great content work? • Treat markup with care • Think accessibility • Represent your document in markup as the spec intended • Use HTML 4.01, XHTML, XML • Separate presentation from design • No presentational markup • Externalize CSS and JavaScript
Markup • How many times have we seen this? • Bad: <p class="heading2"> • Worse: <p style="font-weight:bold; font-size:2em; color:#666;"> • OMG: <b><i><font size=1><font=#666666>… • What about just using <h2>? • This is the tag the spec wants you to use. • This gives common, established, accepted semantic meaning and structure to the document.
Markup Guidelines • Use <p> for paragraphs, not <br><br>. • Use <ul><li> and style with CSS, instead of trying to do custom bullets with images. • Navigation: List of links • Forms: List of choices • Use heading tags. • Top level <h1>, next level down <h2>, and so on, in order.
Guidelines, continued… • Images • Use the alt property appropriately. • Should be a concise yet descriptive representation of the image • longdesc property: URL that points to a detailed description of the image content.
<img> Example Text-Only: Standard browser: Decent altattribute No alt attribute
More forgotten tags • Use <label>, <fieldset>, and <legend> for form elements. • Use <dl>, <dt>, and <dd> for definition lists. • Use <abbr> for abbreviations and acronyms. • Use the title property to expand the abbreviation, i.e. <abbr title="Department of Energy">DoE</abbr>. • <acronym> will be deprecated.
XML • Treat your HTML like XML. • Use XML to take semantic structure up to the next level beyond HTML. • Good support for XML/XSLT in modern browsers and search engines. • Server side parsers are available to assist with backwards compatibility and data manipulation.
How this affects SEO • Use HTML tags as they were intended to be used in the spec. • Search engines are tuned to understand HTML and place weight accordingly (<h1> vs. <p>, for example). • Spiders can crawl for definitions, lists, images, etc, if properly tagged. • Search engines can’t read images or plugins. (Flash can be an exception.) • Orientation is on text, not design.