semantic-markup

Markup for postal addresses

送分小仙女□ 提交于 2019-11-27 01:43:08
Which HTML5 markup should we use for postal addresses? And which vocabulary could we use for enabling machine-readability? As an example, the address of W3C’s main office : W3C/MIT 32 Vassar Street Room 32-G515 Cambridge, MA 02139 USA The address element must only be used if this postal address represents the contact information for "its nearest article or body element ancestor", which, of course, is not the case for all addresses. But if address is used or not, it doesn’t affect the following. The whole address should be enclosed in a p element , because "an address is also a paragraph". As

Is there a standard method for naming classes? [closed]

本小妞迷上赌 提交于 2019-11-26 23:29:24
问题 For example: class="profile profile-image profile-image-large" OR class="profile profile-image profile-image-small" Is there something wrong with these names or dashes? 回答1: To be perfectly honest, this comes down to individual developers and their own feelings. There are two equally good ways of structuring CSS classes, just like you suggested: .profile.image.large{ width: 300px; } /* Or: */ .profile-image-large{ width:300px; } They achieve the same thing, but when you start thinking broadly

How to semantically provide a caption, title or label for a list in HTML

泄露秘密 提交于 2019-11-26 22:50:11
问题 What is the proper way to provide a semantic caption for an HTML list? For example, the following list has a "title"/"caption". Fruit Apple Pear Orange How should the word "fruit" be handled, in a such way that it is semantically associated with the list itself? 回答1: While there is no caption or heading element structuring your markup effectively can have the same effect. Here are some suggestions: Nested List <ul> <li> Fruit <ul> <li>Apple</li> <li>Pear</li> <li>Organge</li> </ul> </li> </ul

List or longer code snippet inside paragraph

孤街浪徒 提交于 2019-11-26 22:12:06
问题 This question was migrated from Webmasters Stack Exchange because it can be answered on Stack Overflow. Migrated 6 years ago . When writing about algorithms, it is often very convenient to write some (pseudo)code inside a paragraph, or even in the middle of a sentence . To visually support the structure of a more complex sentence, lists come handy too. Obviously, one sentence must not be split across different paragraphs. But in our case it has to be due to HTML nesting rules. Paragraph is

Schema.org: How to extend a Class or Type

人盡茶涼 提交于 2019-11-26 22:08:18
问题 I have to model a product, which has properties that aren't listed in the Schema.org Product type. After seeking in many places, I didn't find anything that fits to my need. How can I extend the Schema.org Product type? 回答1: You could always use other vocabularies (that offer the properties you need) in addition to Schema.org. But if you want to use only the vocabulary Schema.org, you have two options in general: Propose new properties (or classes). You can do this on Schema.org W3C Community

extending html5 microdata event schema

帅比萌擦擦* 提交于 2019-11-26 21:44:00
问题 Have been adding html5 microdata to my online resume, and read in http://www.schema.org/docs/extension.html that you can extend existing schema. I've been trying to extend Event to describe a Job with the following markup: <div class="job" itemscope itemtype="http://schema.org/Event/Job"> <h2 itemprop="name">Web Developer</h2> <div itemprop="organizer" itemscope itemtype="http://schema.org/Organization"> <span itemprop="name">Company Name 2</span> <span itemprop="location">London</span> </div

Valid to use <a> (anchor tag) without href attribute?

元气小坏坏 提交于 2019-11-26 19:28:16
I've been using Twitter Bootstrap to build a site, and a lot of its functionality depends on wrapping things in <a> , even if they're just going to execute Javascript. I've had problems with the href="#" tactic that Bootstrap's documentation recommends, so I was trying to find a different solution. But then I tried just removing the href attribute altogether. I've been using <a class='bunch of classes' data-whatever='data'> , and having Javascript handle the rest. And it works. Yet something's telling me I shouldn't be doing this. Right? I mean, technically <a> is supposed to be a link to

Most common way of writing a HTML table with vertical headers?

穿精又带淫゛_ 提交于 2019-11-26 18:58:36
问题 Hi all it's been a while since I've asked something, this is something that has been bothering me for a while, the question itself is in the title: What's your preferred way of writing HTML tables that have vertical headers? By vertical header I mean that the table has the header ( <th> ) tag on the left side (generally) Header 1 data data data Header 2 data data data Header 3 data data data They look like this, so far I've come up with two options First Option <table id="vertical-1">

HTML 5 Page without main <header>?

♀尐吖头ヾ 提交于 2019-11-26 18:36:40
问题 Is it bad to nave no <header> ? I have this basic structure but I am thinking about wrapping a header arround everything between the body start and the content because the header has also this nice shema.org markup attached. Good Idea? Just because sometimes the header is not there but the navbars actually contain the brandname and are sort of headers themseves. if I do this how should I markup whats the <header> right now? A section inside a header is not valid right? Just a normal <div> I

Is it ok to use <strong> in place of <b> blindly?

喜你入骨 提交于 2019-11-26 18:05:17
问题 Note: I know <b> is presentational and <span style="font-weight:bold> is a better way, and <strong> and <em> are for emphasis but my question is not regarding this. Should we convert every <b> to <strong> blindly? Many people do this, they think <b> is not good as per web standards so they convert every <b> to <strong> upon site redesign, content re-population, new site design and people suggest this to others also. Dreamweaver has also given the option to convert all <b> and <i> to <strong>