semantic-markup

Can I use the <nav> tag for pagination?

荒凉一梦 提交于 2019-12-03 16:21:57
It's very common to see the usage of the tag <nav> in a main menu navigation, but I don't know other examples where I can use it. For example, for pagination: <div class='my-pagination'> <!-- first, 2, 3, 4 ... 8, 9, last --> </div> Can be: <nav class='my-pagination'> <!-- first, 2, 3, 4 ... 8, 9, last --> </nav> Is it semantic? Yes. The HTML5 spec defines the nav element like this: The nav element represents a section of a page that links to other pages or to parts within the page: a section with navigation links. Pagination clearly consists of "links to other pages", and these are

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

為{幸葍}努か 提交于 2019-12-03 15:02:00
This question already has an answer here : Why use HTML5 tags? [duplicate] (1 answer) 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>, <header>, <footer> ? What is their advantage over <div id="aside/header/footer"> ? These tags have no specific sub

When is it semantically correct to use the hr element?

假装没事ソ 提交于 2019-12-03 15:01:30
问题 The HTML5 reference says that The hr element represents a paragraph-level thematic break, e.g. a scene change in a story, or a transition to another topic within a section of a reference book. That description is not enough descriptive to me. I use the hr element in my HTML documents as a way to separate content. Is this correct? Could anyone give a few examples on when to use it (apart from the examples shown) and when to use CSS styling instead? 回答1: It's proper to use it when you have, say

Semantic HTML for confirmation, error and warnings messages

大憨熊 提交于 2019-12-03 14:19:35
What are people's opinions on semantic HTML for confirmation, error and warnings messages? Currently I have something simple like: <div class="message message-warning"> <h3>Message Title</h3> <p>Message text</p> </div> Whereby the message-warning class gets replaced by message-confirmation or message-error if the message is a different type. Is there a more semantic way of marking this up? May I suggest <figure> ? Excerpt from HTML5 Doctor (and they, from W3C ): The figure element represents a unit of content, optionally with a caption, that is self-contained, that is typically referenced as a

What is semantic markup, and why would I want to use that?

社会主义新天地 提交于 2019-12-03 13:04:55
Like it says. Using semantic markup means that the (X)HTML code you use in a page contains metadata describing its purpose -- for example, an <h2> that contains an employee's name might be marked class="employee-name" . Originally there were some people that hoped search engines would use this information, but as the web has evolved semantic markup has been mostly used for providing hooks for CSS. With CSS and semantic markup, you can keep the visual design of the page separate from the markup. This results in bandwidth savings, because the design only has to be downloaded once, and easier

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

倖福魔咒の 提交于 2019-12-03 12:29:47
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</h1> <h2>A developing web developer</h2> <p>Hello World</p> Could anyone either come up with a

Please explain rowspan and colspan, col and colgroup

眉间皱痕 提交于 2019-12-03 11:35:21
Can anyone explain rowspan and colspan , col and colgroup ? And are these W3C valid and semantically correct? Under which circumstances are these useful? colspan <table border="1"> <tr> <th colspan="2">people are...</th> </tr> <tr> <td>monkeys</td> <td>donkeys</td> </tr> </table> rowspan <table border="1"> <tr> <th rowspan="2">monkeys are...</th> <td>... real monkeys</td> </tr> <tr> <td>... 'unreal' monkeys (people...)</td> </tr> </table> w3c as you see, this is for connecting table-cells - and because this is sometimes neccessary, it's valid (RegDwights links will give more information...).

What was the thinking behind the implementation of the dropdown menu in Twitter Bootstrap?

﹥>﹥吖頭↗ 提交于 2019-12-03 09:11:00
问题 I've been looking at Twitter's Bootstrap framework and I'm really impressed. However, I don't understand the thinking behind the way the dropdown navigation menu works. Firstly, in order to see child links, you have to click on the parent. I can see the benefits of this, but why not have the more traditional dropdown on hover approach as the default? Secondly, it seems that the thinking behind the Twitter Bootstrap's dropdown menu illuminates parent pages. I'm probably not explaining that

How to tag a photo to be used as a thumbnail when a page is linked to on Facebook

╄→尐↘猪︶ㄣ 提交于 2019-12-03 08:00:48
问题 When a person posts a link on Facebook, Facebook automatically finds a photo to be used as a thumbnail that shows up in the news feed. Is there some sort of (HTML) markup to surround a photo you'd like to use as the first choice? 回答1: What you want are the <meta> tags that Facebook defines in their documentation on Facebook_Share/Specifying_Meta_Tags. You don't put the metadata around the image itself, rather, you put it in the head of the document, like this: <meta name="title" content="The

When can I safely use the new <main> element in HTML5?

ⅰ亾dé卋堺 提交于 2019-12-03 07:34:29
问题 On the 16th December, a HTML5 extension specification for the <main> element was submitted to the W3C under something called an editors draft. The abstract is as follows: This specification is an extension to the HTML5 specification [HTML5]. It defines an element to be used for the identification of the main content area of a document. All normative content in the HTML5 specification, unless specifically overridden by this specification, is intended to be the basis for this specification. The