semantic-markup

Can't style HTML5 elements in IE (despite shiv and display:block)

左心房为你撑大大i 提交于 2019-12-11 07:28:41
问题 I can't seem to work out what's missing. All the affected elements have display:block Example style for the header element: header { width: 923px; height: 55px; background: #395168; margin-top: 25px; } 回答1: IE 6-8 doesn't know about the header tag, so that the styles can't be applied to it. To make IE to understand this tag, add the below script in your head section. <script language='javascript'> document.createElement('header'); </script> This would solve your problem. 回答2: Solved the issue

Element for a card/card-container in HTML5?

依然范特西╮ 提交于 2019-12-11 04:26:28
问题 The specification for the article element says: The article element represents a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content. So, if I'm building a website where, in its

Header in semantic HTML5

◇◆丶佛笑我妖孽 提交于 2019-12-11 03:39:17
问题 I am designing a semantic mark-up of my HTML page. The page consists of a main content block and of a side bar. There are several independent blocks in the side bar like latest news, links, statistics e.t.c. Each block has a header with a block name: "Statistics", "Links" e.t.c. The question. Is it a semanticly correct usage of the tag header if I put a block name in the header tag like <section id="News"><header>News</header><ul>...</ul></section> . Is it a semanticly correct to put the name

Can we use <a> directly in the body, or it should always in any block level tag? See example (XHTML)

天大地大妈咪最大 提交于 2019-12-11 02:49:30
问题 Which is right? This: <h2>heading 2</h2> <p><a href="#" target="_blank" title="Opens in a new window">link 1</a></p> <h2>heading 2 </h2> <p><a href="#" target="_blank" title="Opens in a new window">link 2</a></p> <h2>heading 2 </h2> <p><a href="#" target="_blank" title="Opens in a new window">link 3</a></p> <h2>heading 2 </h2> <p><a href="#" target="_blank" title="Opens in a new window">link 4</a></p> or this: <h2>heading 2</h2> <a href="#" target="_blank" title="Opens in a new window">link 1

How to Establish Relationships between rdfa lite nodes

孤人 提交于 2019-12-11 02:14:48
问题 trying to semantically mark up a report page about specific addresses. The page provides a report about the address's energy consumption and presents offers for a service related to the energy consumption. I would like to semantically represent the place's address, the energy report related to the address, and offers that are available to the address. Right now, I have markup that has an RDFa lite node for place and another node for the offers. What is the best way to structure this to

HTML5 semantic tag usage, will search engines respect large wrapping?

被刻印的时光 ゝ 提交于 2019-12-11 02:13:14
问题 I was planning to use the <nav> tag for a few things, however, the following occurred to me. Take the following markup for example: <nav id="sidebar"> <div class="links"> <a href="/"></a> <a href="/"></a> <a href="/"></a> </div> <div class="links"> <a href="/"></a> <a href="/"></a> </div> <div class="links"> <a href="/"></a> </div> <div class="statement"> random content here, unrelated to navigation </div> <div class="randomstuff"> unrelated to navigation, but still here </div> </nav> Will

Is role=“main” necessary on a <main> element?

ぃ、小莉子 提交于 2019-12-11 01:37:13
问题 It seems redundant to use an ARIA landmark if the most semantic and accessible way to define the main section of your content is the standard <main> element. Is adding role="main" to the element really necessary? 回答1: Not all modern browsers have already mapped the aria-role main to the <main> element (so far only Firefox 21+ and Chrome 26+ have mapped it). When all browser will support this feature, then the attribute role="main" could be dropped, but in the meanwhile it's better to still

Can I have a nav element with no links in it?

早过忘川 提交于 2019-12-11 01:06:40
问题 <nav> typically has <a> elements inside it, but is it required? I have a radio button form whose purpose is akin to navigation. It doesn't navigate to other pages on the Internet, but instead changes the visibility of elements within the body of the HTML document (like a carousel). Thanks! I've been wrestling with semantic markup tonight! 回答1: tl;dr : No, the nav element requires links (but not necessarily a elements). W3C’s HTML5 defines the nav element like this: The nav element represents

Is it semantically correct to have an action button column in an html table?

冷暖自知 提交于 2019-12-10 18:20:08
问题 Say you have some tabular data you want to display, as well as allow the user to perform some action on a row. Is that semantically correct to have an "action" column? (could be "edit", "vote", or whatever) If so should the action text be in the header cell with an icon in the actual column, or should that text be repeated on each cell (in the form of a button or link) and the header cell blank? 回答1: I think this would be fine. If the action directly relates to the table and the table

What is the best way to semantically structure a FAQ?

我怕爱的太早我们不能终老 提交于 2019-12-10 17:36:49
问题 I am wondering how I should structure a FAQ to keep the semantic meaning of the content. I think of using defintion list, as the close relation between a question and an anwser may have together. What are your thoughts about this? 回答1: Yes, I prefer to use a definition list. Your other options are to use headings (h2 etc) for the questions, and paragraphs for the answers, or to put them in a table with a column for the question and a column for the answer. I would lean towards definition