Should I have aside element ouside or inside of main element?

In HTML5 it’s only defined that aside is “related to the content around the aside element”. In HTML 5.1 (CR) the definition became more specific, as it now says that aside is “related to the content of the parenting sectioning content“. Following the newer definition, the aside element should be inside of the section element … Read more

What is the most semantic way to display a street address in HTML?

You could use the hCard Microformat to describe your address. The advantage of Microformats is that you can use them in your existing documents to enrich them. Here’s an example derived from the example from the Microformats wiki: <address class=”vcard”> <span class=”adr”> <span class=”street-address”>169 University Avenue</span> <span class=”locality”>Palo Alto</span>, <abbr class=”region” title=”California”>CA</abbr>&nbsp;&nbsp; <span class=”postal-code”>94301</span> <span … Read more

nav role=navigation

It is true that most modern browsers/technologies recognise the HTML5 <nav> element as navigation and give it the same attention. But explicitly setting the role=”navigation” attribute just makes sure that a lot more technologies can pick it up. For example screen-readers and other technologies for users with disabilities are very rarely fully standards compliant (especially … Read more

w3c html validation error – Section lacks heading. Consider using h2-h6 elements to add identifying headings to all sections

Either: Add a heading (h1, …, h6) tag to your section element. Replace your section element with a div element. Ignore the warning. The message you’re seeing is a non-normative usage recommendation, as per the HTML5 spec (highlighting mine): The theme of each section should be identified, typically by including a heading (h1–h6 element) as … Read more

What html markups to use for displaying label/value data?

I think the most semantically correct would be <dl>, <dt> and <dd>, since what you’re displaying are effectively definitions of first name, age and e-mail. <dl> <dt>First Name</dt> <dd>Dominic</dd> <dt>Age</dt> <dd>24</dd> <dt>E-mail</dt> <dd>foo@bar.com</dd> </dl> However, obviously, the easiest way to display it in a table is using <table>, <th> and <td>. You could hack together … Read more

Using custom HTML Tags

Most of these responses are good general advice, but not proper answers to the question, which I think is perfectly legitimate. HTML5 is already a moving target; browsers implement specs and innovate at different paces. There is no single thing called “valid HTML”, at least not that is worth using. If you are building a … Read more

Is it ok to use in place of blindly?

As others have mentioned, using <strong>, <em>, <cite> etc. adds semantics. This is important because you say something about why you want to emphasize something and increase the readability of your html, because you know why it’s in bold. Furthermore, screen readers use the strong tags to make an audible difference when reading it aloud. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)