semantic-markup

HTML5 nav tag correct usage

半城伤御伤魂 提交于 2019-12-04 23:40:19
<ul class="mainMenu"> <li><a href="#">Home</a></li> <li><a href="#">Forum</a></li> <li><a href="#" class="mainSelected">Construct</a></li> <li><a href="#">Arcade</a></li> <li><a href="#">Manual</a></li> </ul> <ul class="subMenu"> <li><a href="#">Homepage</a></li> <li><a href="#">Construct</a></li> <li><a href="#" class="underSelected">Products</a></li> <li><a href="#">Community Forum</a></li> <li><a href="#">Contact Us</a></li> </ul> Is it more semantically correct to have a <nav> around both these <ul> individually, or should one nav wrap both? Also would it be appropriate to use the nav tag

Semantic markup: Why <header> instead of <div id=“header”>? [duplicate]

狂风中的少年 提交于 2019-12-04 22:16:39
问题 This question already has an answer here : Why use HTML5 tags? [duplicate] (1 answer) Closed 6 years ago . Okay, so I understand the hype about semantic markup: it enhances/ further specifies the meaning of an element or page for search engines, and therefore for humans reading search results. All credits to microformats and <h1>, <h2>, <p> and such, because these tags indicate a hierarchical structure and/or specific purpose and add meaning to the page. But why are there now tags like <aside

HGROUP element removed from the HTML5 Specification. What alternative technique can be used instead?

假装没事ソ 提交于 2019-12-04 18:09:12
问题 As some of you would of heard the hgroup element is being removed from the HTML5 Specification. (For more info, see the W3C HTML Working Group's decision on request to drop hgroup from HTML5 on the W3C's Public Mailing List archives.) Now I'm currently working on the redesign of a site using this tag that creates a way of adding a sub heading. My current thoughts are to just add another hX tag under the main header, but I'm not sure if this would be semantic enough to do so. <h1>Darren Reay<

Which elements are “valid” to place inside <td> tag?

匆匆过客 提交于 2019-12-04 16:22:39
问题 I know that it's not a good idea to place div inside td , but what about span and other elements? Which elements are ok to place inside td and which are not and why? Edit: The problem is that I have an old table layout and I need to make modifications there. To do so, I need to add elements inside td , so what elements will be the least evil to insert into <td> ? 回答1: The HTML spec specifies which elements may be direct decendants of other elements. The <td> element has a flow content content

In which element should I enclose an <article />'s comments?

≡放荡痞女 提交于 2019-12-04 16:04:00
问题 I'm working on a blog that implements Disqus comments and I'm making an effort to make as much use of HTML5 semantic markups as possible. Here's an example <article /> (itself within a <section /> ), fairly simple: <article class="post"> <header> <h2>Title</h2> <p class="posted-on">Posted on <time datetime="2012-07-28T13:00:24+01:00">July 28th 2012</time>.</p> </header> <p>Lorem ipsum dolor sit amet...</p> <p>Lorem ipsum dolor sit amet...</p> <!-- blog comments --> </article> With the above

Which HTML5 tag should I use to mark up an author’s name?

自作多情 提交于 2019-12-04 07:35:25
问题 For example of a blog-post or article. <article> <h1>header<h1> <time>09-02-2011</time> <author>John</author> My article.... </article> The author tag doesn't exist though... So what is the commonly used HTML5 tag for authors? Thanks. (If there isn't, shouldn't there be one?) 回答1: HTML5 has an author link type: <a href="http://johnsplace.com" rel="author">John</a> The weakness here is that it needs to be on some sort of link, but if you have that there's a long discussion of alternatives here

Semantic HTML Practice

懵懂的女人 提交于 2019-12-04 07:07:45
I read about semantic HTML online... Semantic HTML means using HTML tags for their implied meaning, rather than just using (meaningless) div and span tags for absolutely everything. If you use <h1> instead of <div class="header"> , and <h2> instead of , et cetera, Google and other search engines will interpret your headers as being important titles in your page. This way, when people search on the words in your headers and sub-headers, your page will be considered more relevant (and rank higher). Plus, it's much shorter and cleaner. So, below is semantic, <h1>My Website Name</h1> <h2>My

Unorthodox use of html5 nav tag

▼魔方 西西 提交于 2019-12-04 06:55:19
问题 I have made "creative" use of the new html5 elements, sometimes pushing the intended boundaries a bit. Like most, my site is mainly made of articles comments and links to other articles. I decided that I'd use the article tag just once, so there's no confusion whatsoever. For comments, I'm using the aside element and I think that it fits the definition - it's related to the content but it can be done without. In the case of links to other articles (actually, titles with excerpts and taxonomy

HTML element for ad?

若如初见. 提交于 2019-12-04 02:42:12
Is there any authoritative information on the web concerning which HTML element to chose for an advertisement banner? I considered <article> or <aside> , but I think more appropriate is simply: <div class="ad"> In most cases I'd use the aside element : The element can be used for […] for advertising , […] and for other content that is considered separate from the main content of the page. As the aside element is a sectioning element, it creates an entry in the document outline, even if you don't use a heading explicitly. In most cases this would be what you want. If you don't host the ad

Is it allowed to use other tags inside <title>?

半世苍凉 提交于 2019-12-04 00:22:26
问题 Is it correct practice or valid syntax to use other tags inside a <title> ? An example for multi-language title <html lang=en> <title>Some title in English and a <i lang=fr>word in French</i></title> 回答1: See http://www.w3.org/TR/html401/struct/global.html#h-7.4.2: Titles may contain character entities (for accented characters, special characters, etc.), but may not contain other markup (including comments) . (my emphasis) 回答2: No, it may not http://www.w3.org/Provider/Style/TITLE.html 回答3: