# HTML Review of template for site - Is this ok for HTML5?

Writing a new site, has anyone got any comments on the HTML here? Is it all semantically correct? Thanks! This will basically be the template, so I want to make sure it's pretty perfect.

<!DOCTYPE html>
<html>
<title>Welcome to Scirra.com</title>
<meta name="description" content="Construct 2 is a free open source HTML5 games creator." />
<meta charset="UTF-8" />

<script type="text/javascript" src="js/common.js"></script>

<script type="text/javascript" src="plugins/coin-slider/coin-slider.min.js"></script>

<script type="text/javascript" src="plugins/jquery.twit.0.2.0/twit.min.js"></script>

<script type="text/javascript">
$(document).ready(function() {$('#coin-slider').coinslider({ width: 470, height: 261, spw: 8, sph: 4, delay: 7000, effect: 'straight', hoverPause: true });

limit: 5,
label: '',
icon: false,
count: 20
});
});
</script>

<body>

<div class="topBar"></div>
<div class="mainBox">
<div class="searchBox">
<div class="searchContent">
<input type="text" id="SearchBox" />
<div class="s searchIco"></div>
</div>
</div>
</div>
</div>
</div>
<div class="contentWrapper">
<div class="wideCol">
<div class="s slideShowWrapper">
<div id='coin-slider'>
<a href="#" target="_blank">
<img src='images/screenshot1.jpg' >
<span>
Scirra software allows you to bring your imagination to life
</span>
</a>
<a href="#">
<img src='images/screenshot2.jpg' >
<span>
Export your creations to HTML5 pages
</span>
</a>
<a href="#">
<img src='images/screenshot3.jpg' >
<span>
Another description of some image
</span>
</a>
<a href="#">
<img src='images/screenshot4.jpg' >
<span>
Something motivational to tell people
</span>
</a>
</div>
</div>
<div class="newsWrapper">
</div>
</div>
<div class="thinCol">
<h2>Help Me!</h2>
<p>This column will keep expanging and expanging.  It pads stuff out to make other things look good imo.</p>
<p>As well as other features, we also have some other features.  Check out our <a href="#">other features</a>.  Each of our other features is really cool and there to help everyone suceed.</p>
</a>

</div>
<div class="clear"></div>

<h1>This Weeks Spotlight</h1>
<div class="halfColWrapper">
<img src="images/spotlight1.png" class="spotLightImg" />
<p>Our spotlight member this week is Pooh-Bah.  He writes good stuff.  Read it.</p>
</div>
<div class="halfColSpacer">&nbsp;</div>
<div class="halfColWrapper">
<img src="images/spotlight2.png" class="spotLightImg" />
<p>Killer Bears is a scary ass game from JimmyJones.  How many bears can you escape from?</p>
</div>
<div class="clear"></div>
</div>
</div>

<div class="footer">
<div class="footerContent">
<div class="footerItem">
<h3>Community</h3>
<a href="#">The Blog</a><br />
<a href="#">Community Forum</a><br />
</div>
<div class="footerItem">
<a href="#">Contact Information</a><br />
<a href="#">History</a><br />
<a href="#">Terms and Conditions</a>
</div>
<div class="footerItem">
<h3>Want to Help?</h3>
You can contribute to Scirra software as it is <a href="#">Open Source</a>.  We welcome all contributions, and there are lots of ways to join in!<br />
<div class="ralign">
</div>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</body>
</html>


Looks great in all browsers, but want to check it's valid markup and as perfect as it could be.

• The validator says it looks good. – Josh K Feb 20 '11 at 21:11
• Why such a short DOCTYPE? – Peter Taylor Feb 20 '11 at 22:51
• @Peter I was under the impression that's the HTML5 doctype – Tom Gullen Feb 20 '11 at 23:03
• @Peter no worries! I was also pleasantly surprised to see that is the new doctype. – Tom Gullen Feb 21 '11 at 9:05
• always declare the charset first (before the title and meta description) – Knu Feb 22 '11 at 17:20

If you are going with HTML5, I would suggest a few more things:

1. Lose the type="text/javascript" from the script tags - you don't need them in HTML5
2. Same goes with type="text/css" on link tags
3. Keep your self-closing XML syntax consistent - on some tags you have the closing />, on some you don't (it doesn't matter which way, just make it consistent)
4. Consider placing .js files at the bottom of the document - that way the page can start rendering before it's downloaded them all. Often these are required for post-rendering functions anyway - so do your users a favor and put them at the bottom of the document.
• On the HTML5 kick, I'd consider using the new semantic tags such as header and footer instead of a div with a class. nav looks appropriate in this case too. – Sapph Feb 26 '11 at 13:24
• Agreed - for a great intro to HTML5, I recommend diveintohtml5.org. – wows Mar 14 '11 at 23:45
• Improvement: the defer and async attributes can be used on the script tag so it stops delaying page load. – ANeves thinks SE is evil Feb 27 '12 at 10:33

Some things that come to mind:

• Don't use inline javascript
• Use an <ul> with <li> items for a menu, this is semantically more correct
• Always use an alt tag on <img>
• Don't use <br> tags, use <p> if we're talking about text. Use css (display:block) if you want to force an element to the next line.
• Use IDs when there is only one occurence per page, e.g. <div id="footer">

Looks like a lot of extra <div>s, as far as I can see. Why do you have .footer and .footerContent? Generally a <div> without any siblings can be killed.

And that header looks really out of control. Any reason for wrapping the input and search icon in 4 lonely <div>s?

You should also avoid this: class="blueLinkBox". Because what happens when you change your design to be orange? Would you then rename all your link boxes, or just try to remember that blueLinkBox are those orange boxes? Name your classes by their content. .importantLink or .readMoreLink might be better names.

You also have some links without any content or title attribute, which is bad for screen readers, seo and other stuff that can't "see" your website.

It's not a good idea to have multiple <h1>s on one page. There are of course exceptions (eg: scrolling-for-navigation), but this page doesn't seem to fit... Because what you're saying now is that "this weeks spotlight" is as important as the main features of your product, which I'm guessing (hoping) is not the case.

The validator says there are a lot of meta tag values missing (about 10) and that there a 2 starting <body> tags.

• I don't see those warnings. – Carson Myers Feb 27 '11 at 22:22