semantic-markup

Does it matter <strong> in <em> or <em> in <strong>?

萝らか妹 提交于 2019-11-29 18:31:04
问题 Does it matter <strong> in <em> <p><strong><em>Some text</em></strong></p> or <em> in <strong> ? <p><em><strong>Some text</strong></em></p> Which is semantically correct and more accessible? Update: How screen reader would behave in both situation? 回答1: Syntactically correct but not semantically correct. <strong> is an "higher order" form, so to speak, of <em> . If you're looking for the effect of <b> and <i> , use CSS. Remember to not choose elements because of how they look but what they

Is it fine to use span elements in div elements?

醉酒当歌 提交于 2019-11-29 18:16:07
I am making a website with personal articles. The body of my articles is a basic div containing paragraphs, but recently I found it useful to use some span 's out of the paragraphs to manage my content as desired, hence in the div 's. As the web semantic becomes an important role and becomes more and more well constrained, I was curious of the downsides of such a practice. I am not too familiar with the standards of HTML yet. However, I was thinking using span 's in div 's is semantically not clean. Is the Googlebot going to soil the referencing on that? There is nothing wrong with using a

Placeholder VS Label for input in HTML5

帅比萌擦擦* 提交于 2019-11-29 18:03:46
问题 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? 回答1:

Proper use of HTML heading tags

不打扰是莪最后的温柔 提交于 2019-11-29 16:16:55
I'm having trouble understanding the proper usage of HTML headings. I'm using books and online resources to self-learn but there are slight discrepancies on how to use them. [1] "Note that the h1 tag is only used once, as the main heading of the page. h2 to h6 , however, can be used as often as desired, but they should always be used in order, as they were intended. For example, an h4 should be a sub-heading of an h3 , which should be a sub-heading of an h2 ." OR [2] "the logical heading level reflects its importance in relation to the main content." So the question is: do I use them in order

html5, figure/figcaption inside a paragraph gives unpredictable output

故事扮演 提交于 2019-11-29 14:22:32
问题 The following markup uses the figure element to display an image, inline with the text of a paragraph -- hence the figure is 'included' inside the first <p> . <div class="object-content"> <p> <figure class="object-inline-figure"> <img class="object-inline-figure-image" height="200" src="/site_media/media/files/images/WH-487_opt.jpeg" width="300"> <figcaption class="object-inline-figcaption"> <p class="object-inline-figcaption-caption">Lorem ipsum dolor sit amet, consectetur adipiscing elit.<

Using section element for stylistic layout and wrappers

风流意气都作罢 提交于 2019-11-29 11:01:56
I often use divs for stylistic layouts(pieces of markup with no content, specifically focused on the design) and wrappers on sites. With that said, Why should sections not be used for this task? Does a section by itself have an inherent semantic meaning that discourages it being used for wrappers? Almost every page I use has some wrapper or stylistic layout of some sort. Wanting to phase out divs, I wonder, if sections can be used for wrappers and still be semantically correct. unor Yes, the section element has an "inherent semantic meaning". See the definitions in the HTML5 spec: div element

<b> vs <span> in HTML5

自闭症网瘾萝莉.ら 提交于 2019-11-29 06:59:25
I've been having difficulty deciding when to use b and when to use span. The new semantics of the b element seem vague. The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood It sounds like that tag you use when you can't use strong, em, or i. The b element should be used as a last resort when no other element is more appropriate. But we've already got span for when phrasing content doesn't already have an applicable tag. The span element doesn't mean

The correct approach to markup “keywords” of a blog post by using HTML5 and Microdata?

牧云@^-^@ 提交于 2019-11-29 05:05:50
The keywords property from Schema.org, as it being in plural form suggests, seems to imply its value should be a line of comma-separated text . Like the following example: <p itemprop="keywords">lorem, ipsum, dolor, sit, amet</p> That reminds me of the <meta name="keywords" content="lorem, ipsum, dolor, sit, amet"> tag we used to put within <head></head> for SEO reason. However, from semantics' perspective, I think the above example is incorrect because keywords should be a list of words . Thus it should be markuped by using the <ul> element. Is there a common consensus on how the keywords of

Is it good to put a   inside an empty <td>?

谁都会走 提交于 2019-11-29 02:57:46
If this is the structure: <table cellspacing="0" cellpadding="0"> <tr> <td>I don't need anything here, should I always put a   here?</td> <td>item </td> </tr> <tr> <td>model</td> <td>one</td> </tr> <tr> <td>model</td> <td>two</td> </tr> <tr> <td>model</td> <td>three</td> </tr> </table> How will a screen reader read a blank td ? Is it semantically correct? Semantically correct IMHO would be to keep an empty cell really empty. However, I, too, fill empty cells with   s for pragmatic reasons. As for screen readers, I'll have to make an educated guess: Empty nodes will likely not be read, because

Why <big> is not in HTML 5 Tag list while <small> is?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 21:43:51
问题 Shouldn't both be removed? Or does it mean we should use <small> ? Why is <big> removed but <small> is not? What is the problem with <big> which does not apply to <small> ? http://www.w3schools.com/html5/html5_reference.asp 回答1: Remember, the tags are meant to be semantic, not presentational. There is such a thing in English as "fine print". This is what the small tag represents. There is no analogous concept of "big print" except for a header, which is already covered by seven other tags.