semantic-markup

How to properly use h1 in HTML5

て烟熏妆下的殇ゞ 提交于 2019-11-27 10:50:23
Which of the following is the correct way to structure a page: 1) h1 only in header <header> <h1>Site title</h1> <nav>...</nav> </header> <section> <h2>Page title</h2> </section> If I use h1 exclusively inside header as the site's title, every page will have the same content for the h1 tag. That doesn't seem very informative. 2) h1 in header and section , for both site and page title <header> <h1>Site title</h1> <nav>...</nav> </header> <section> <h1>Page title</h1> </section> I've also seen examples of using h1 more than once, in both header and section tags. However, isn't it wrong to have

CSS/HTML: What is the correct way to make text italic?

筅森魡賤 提交于 2019-11-27 10:34:45
What is the correct way to make text italic? I have seen the following four approaches: <i>Italic Text</i> <em>Italic Text</em> <span class="italic">Italic Text</span> <span class="footnote">Italic Text</span> <i> This is the "old way". <i> has no semantic meaning and only conveys the presentational effect of making the text italic. As far as I can see, this is clearly wrong because this is non-semantic. <em> This uses semantic mark up for purely presentational purposes. It just happens that <em> by default renders text in italic and so it is often used by those who are aware that <i> should

Span inside anchor or anchor inside span or doesn't matter?

拜拜、爱过 提交于 2019-11-27 09:42:42
问题 I want to nest span and a tags. Should I Put <span> inside <a> Put <a> inside <span> It doesn't matter ? 回答1: 3 - It doesn't matter. BUT, I tend to only use a <span> inside an <a> if it's only for a part of the contents of the tag i.e. <a href="#">some <span class="red">text</span></a> Rather than: <a href="#"><span class="red">some text</span></a> Which should obviously just be: <a href="#" class="red">some text</a> 回答2: It is perfectly valid (at least by HTML 4.01 and XHTML 1.0 standards)

How to use <section> and <article> tags in HTML5?

匆匆过客 提交于 2019-11-27 09:38:50
I just confused how to use <article> and <section> tags in HTML5. I referenced lot in Google and also in Stack Overflow website. On that, I found HTML5 pages with <section> elements containing <article> elements, and <article> elements containing <sections> elements. I also found pages with <section> elements containing <section> elements, and <article> elements containing <article> elements. What is the exact use of these tags? It depends on your content. For example, a list of recent blog posts could be a section containing several article (example 1), a complex blog post could be an article

Schema.org - How can you define an object across multiple pages?

孤人 提交于 2019-11-27 08:48:29
问题 Using schema.org markup, if I define many items with the same name across multiple pages, but with different sets of properties defined on each page, is each item only relevant within the scope of the page it is defined on, or is there a way to tie all of them items together to create a single, complete definition? 回答1: Syntax: itemid Microdata defines an itemid attribute: […] to give a global identifier for the item, so that it can be related to other items on pages elsewhere on the Web. The

Marking up a search result list with HTML5 semantics

南笙酒味 提交于 2019-11-27 08:36:47
Making a search result list (like in Google) is not very hard, if you just need something that works. Now, however, I want to do it with perfection, using the benefits of HTML5 semantics. The goal is to define the defacto way of marking up a search result list that potentially could be used by any future search engine. For each hit, I want to order them by increasing number display a clickable title show a short summary display additional data like categories, publishing date and file size My first idea is something like this: <ol> <li> <article> <header> <h1> <a href="url-to-the-page.html">

What support does HTML5 provide for semantic markup and Semantic Web technologies?

房东的猫 提交于 2019-11-27 08:15:58
问题 It seems that, as of right now, there is little to no support in HTML5 for semantic markup using RDFa or Microformats. I've done a little bit of reading, but if I were to start using HTML5 right now, what could I do to support semantic markup (such as microformats) and Semantic Web technologies (such as RDFa)? If I want to utilize these technologies now, should I stick with XHTML? 回答1: (Some years have passed …) For semantically annotating your content in HTML5 documents, you can use

When to use <br> line breaks vs CSS positioning?

三世轮回 提交于 2019-11-27 08:15:26
I've often wondered about the proper use of a <br> line break. Seems that often they are incorrectly used for positioning or clearing content where CSS should instead be used. W3schoools.org says to use <br> for blank lines, but not for creating or separating paragraphs. Looking over W3C HTML5 spec draft , it's a little clearer that the <br> would be used when content requires a line break such as lines of an address or blank lines in poetry, where intended by the author. But I'm still interested in any further clarification or input anyone else. I often find myself opting not to use <br> tags

Shall I use <section> tags inside <aside>?

我是研究僧i 提交于 2019-11-27 07:44:33
问题 Having a markup like this: <aside> <div class="widget"> <h2>Latest news</h2> <ul>...</ul> <a>more news</a> </div> <div class="widget"> <h2>Choose site theme</h2> <input type="select" /> </div> <div class="widget"> <h2>Newsletter subscription</h2> <form>...</form> </div> <div class="widget"> <h2>Related articles</h2> <ul>...</ul> </div> </aside> Which tag is more appropriate here: <div> or <section> ? Is section supposed to be used only inside <article> tag and never inside <aside> ? 回答1: The

Is an HTML5 <header> tag unnecessary if there is only a single <hx> tag inside it? [closed]

China☆狼群 提交于 2019-11-27 04:52:04
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I've searched and have not come up with any useful answers, so here goes: Is an HTML5 <header> tag unnecessary if there is only a single <hx> tag inside it? For instance, I have the following HTML5 markup: <article> <header> <h1>Heading Title</h1> </header> ... </article>