semantic-markup

Is it necessary to have <th> in any table?

大憨熊 提交于 2019-12-01 08:22:49
问题 is it necessary to have <th> in any table? even if table has no heading? table has 3 other tag <thead> <tbody> <tfoot> is it necessary to use all even if i have nothing for table footer. Firefox by default add all these in code. and is it necessary , <th> always should be in a <thead> and if I have a heading in content received from client , and heading is from outside the table but related to table then how should i place that heading for table As a above table <h3>Heading of table<h3>

HTML5 published and modified time

孤人 提交于 2019-12-01 05:59:08
问题 I’d like to include published and modified time of an article. I looked through documentation and cannot find info about this. So far, I got this: <article> <h2>Summer</h2> <p>Also the favorite word of <strong>5000</strong> people more</p> <time pubdate="2009-11-13">1s</time> <time datetime="2009-11-13">10s</time> </article> 回答1: The time element can’t have a pubdate attribute. (It was part of early drafts, but it got removed.) HTML5 itself doesn’t provide a way to specify that a date is a

Style a definitition list as simple key value set

隐身守侯 提交于 2019-12-01 05:28:18
I'd like to use a definition list as simple as: <dl> <dt>name:</dt> <dd>Tomas</dd> <dt>address:</dt> <dd>this is a very long wrapping address</dd> <dt>age:<dt> <dd>29</dd> <dl> to render something like: name: Tomas address: this is a very long wrapping address age: 29 The definition list seems semantically the best option here. Using the new run-in display style will do the trick: <style> dt { display: run-in; } </style> But this isn't widely supported yet. How can I style my definition list for better cross-browser support (ie6 not necessary), without changing the html (currently I use

Semantic implications of multiple <dd> tags

偶尔善良 提交于 2019-12-01 04:42:51
When using <dl> lists to associate keys to values, is there a semantic difference between these 2 samples? Which one provides better semantics? What do multiple <dd> tags imply in this context? Sample 1 : Multiple <dd> items. <dl> <dt>Authors</dt> <dd>John Lennon</dd> <dd>Paul McCartney</dd> <dt>Genres</dt> <dd>Pop</dd> <dd>Rock</dd> </dl> Fangs output: Definition list of two items Authors equals John Lennon equals Paul McCartney Genres equals Pop equals Rock List end Sample 2 : Single <dd> contains <ul> <dl> <dt>Authors</dt> <dd> <ul> <li>John Lennon</li> <li>Paul McCartney</li> </ul> </dd>

What tag should be used for a logo element if the logo is text?

本小妞迷上赌 提交于 2019-12-01 02:33:40
I have read that an <h1> tag is inappropriate for a logo . But if your logo is plain text, what should you use? I feel like <p> and <span> are also unsuitable. Here's a sample: <header> <nav> <a id="logo" href="."> <span>Company Name</span> </a> <a id="linkOne" href="#thingOne"> <img src="…"> </a> <a id="linkTwo" href="#thingTwo"> <img src="…"> </a> <a id="linkThree" href="#thingThree"> <img src="…"> </a> </nav> </header> Thanks! unor Given your markup example, you seem to ask about a link in the nav element. If that’s the case, you should not use a heading element for it, because the heading

HTML 5 Document Outlining Algorithm

≡放荡痞女 提交于 2019-11-30 22:29:38
I am building a new site and I have recently started looking at the Document Outlining Algorithm. It states that all sections should have a header, sections include section , nav , article and body (There are probably some more too). So, I have a couple of navigation areas and my question is; would it be wise to have a heading but just hide it from the browser? unor Every sectioning content element "longs" for a heading element ( h1 - h6 ). But you are not required to provide one. If you don’t provide a heading element for a section, this section will have an implied heading . HTML5 outline

HTML time tag for duration

▼魔方 西西 提交于 2019-11-30 20:44:01
I need to display the duration of a video. Should I use <time> or should it be used only for displaying time as in a clock? Example Is this correct HTML5? <p>Duration: <time>3:30 min</time>.</p> Or should <time> be used only on a situation like this? <p>Good morning. The actual time is: <time>9:45</time></p>. Docs MDN presents the following definition: The HTML element represents either a time on a 24-hour clock or a precise date in the Gregorian calendar (with optional time and timezone information). This element is intended to be used presenting dates and times in a machine readable format.

Facebook link thumbnail

帅比萌擦擦* 提交于 2019-11-30 19:24:50
When posting a link to a website in Facebook (Google+ and the rest count too) you're given a thumbnail, or selection of thumbnails to choose from. These are tags from the HTML. I've always been of the opinion that it was good practice to make my logo a background image inside a h1 tag using CSS. I make the h1 tag a link back to the home page and hide the header text with something like {text-indent: -9999px}, leaving a lovely semantic HTML header. Here's a link to my site if you want a look: http://tempertemper.net The problem with this is that as it's a background image it's overlooked. Would

Is it necessary to have <tbody> in every table?

你说的曾经没有我的故事 提交于 2019-11-30 14:27:38
问题 Is it necessary to have <tbody> in every table? According to Standards. 回答1: Only if you define thead and tfoot . It is mostly used when the table has multiple bodies of content. If the data in the table is easily understood to be the tbody then you can safely omit it. 回答2: For the small fraction of your users still using IE7, you MUST add encapsulate your tr's in a tbody tag if you're building a table with the DOM methods! This will work in all major browsers: var table = document

Placeholder VS Label for input in HTML5

三世轮回 提交于 2019-11-30 12:02:24
I'm Making a form with multiple inputs where I need to give lable of form element inside input itself and I'm using like this An example <form class="TTWForm"> <input type="email" name="email" required="required" placeholder="Email Address"> </form> And above code is Valid in W3C validator for HTML5. Does Label not require in HTML 5? If I'm using HTML5 Placeholder to show label inside input is that ok? Does label still required along with placeholder to make it screen reader compatible? HTML validators will not check accessibility. Valid HTML can still be inaccessible or less than optimal.