semantic-markup

Which HTML5 tags are semantically correct to represent e-commerce products?

倾然丶 夕夏残阳落幕 提交于 2019-12-06 13:28:43
Should I wrap the products with unordered list <ul><li> ? How can I make products clickable without JavaScript, just using HTML? Can I wrap each product with: <a href="linkToProduct"> <article> <h3>Product 1</h3> <img src="images/product1.png" alt="product 1"> <p><data value="50">50</data>$</p> </article></a> Here is my code : <section id="my-products"> <h1>My Products</h1> <article> <h3>Product 1</h3> <img src="images/product1.png" alt="product 1"> <p><data value="50">50</data>$</p> </article> <article> <h3>Product 2</h3> <img src="images/product2.png" alt="product 2"> <p><data value="130"

CSS :before content two colors

喜欢而已 提交于 2019-12-06 13:22:56
问题 I have a structured semantic data that I would like to display, styling it with CSS. Here is a sample: ...<user name="John">...</user>... I would like it to be rendered like this: ... User John ... ... If I wanted 'User' and 'John' to have the same color, I could use the following CSS: user:before{ content: 'User ' attr(name); } However, I want 'User' to be blue, and 'John' to be red. How can I achieve this with CSS? P.S. I don't want to transform my data representation. I know I could easily

How can I write a form that assists my browser's auto-complete feature?

 ̄綄美尐妖づ 提交于 2019-12-06 07:23:01
问题 How does Chrome, or other browsers, determine what data is appropriate to auto-complete into a particular form field? Is it just based on the name and type? Are there other semantic / microdata standards I should be aware of that can give it a hint? I seem to recall reading a standard of form field hints for chrome, but I can't find that article anymore. 回答1: HTML5 defines: When the autofill field name is " on ", the user agent should attempt to use heuristics to determine the most

Semantic HTML Practice

家住魔仙堡 提交于 2019-12-06 03:34:12
问题 I read about semantic HTML online... Semantic HTML means using HTML tags for their implied meaning, rather than just using (meaningless) div and span tags for absolutely everything. If you use <h1> instead of <div class="header"> , and <h2> instead of , et cetera, Google and other search engines will interpret your headers as being important titles in your page. This way, when people search on the words in your headers and sub-headers, your page will be considered more relevant (and rank

Valid use of <q>, <blockquote> and <cite>

落花浮王杯 提交于 2019-12-06 02:14:00
问题 Is this valid use of q , blockquote and cite ? <q>Life is what happens when you're busy making other plans</q> <cite>John Lennon</cite> or <blockquote>Life is what happens when you're busy making other plans</blockquote> <cite>John Lennon</cite> 回答1: <q> The q element represents some phrasing content quoted from another source. <p>And then he said <q>I heart HTML5.</q></p> <cite> The cite element represents the title of a work (e.g. a book, a paper, an essay, a poem, a score, a song, a script

Is it necessary to use H2 after h1

情到浓时终转凉″ 提交于 2019-12-05 12:12:56
Is it mandatory to use H2 after h1 if text is too small then can we use h4 after h1 . and is it accessible ? Toon Krijthe Technically you can use any combination of those. Semantically, it's wise to use the common order. And if the font size is too small, use CSS to change that. With the tags h1 - h6 you give a semantic meaning to a title. Where h1 is for the top level, h2 for a subdivision of h1 , h3 for a subdivision of h2 etc. You can change the appearance by setting CSS rules, which is great because now you can separate content from layout. You should always structure the document

Is it semantically correct in HTML to markup a list with only a single list item?

萝らか妹 提交于 2019-12-05 09:28:01
Is it semantically correct to markup a ul in HTML with another embedded ul that has only one single list item? For example, I have a ul with several li s, and one of those li s has an embedded ul with a single li : <ul> <li>Example LI 1 <ul> <li>Example LI 1a</li> </ul> </li> <li>Example LI 2</li> <li>Example LI 3</li> </ul> Absolutely. A list is not defined by quantity. It's defined by semantics. So a list can consist of only one element if only one item applies to the list's purpose. For example, I have only crashed one computer today so that list would be only one element long. Yes, it is

Does the h1 need to be the first semantic element in a header tag?

烈酒焚心 提交于 2019-12-05 03:41:46
I am using a Chrome outliner extension to check the semantics of my page. It seems to be a problem to have any structural element before the h1 in the document main header tag. I was thinking the order does not matter, but apparently it does: +Document Body +Header +nav +h1 Main Navigation +h1 MyPage -Section -Footer Does outline like this: Untitled Body Main Navigation MyPage etc... But when the h1 is the first element in my header: +Document Body +Header +h1 MyPage +nav +h1 Main Navigation -Section -Footer it does outline like this: MyPage Main Navigation etc... Why is that? Is the outliner

Semantic use of <label> also out of a <form>?

寵の児 提交于 2019-12-05 02:26:04
问题 I have a doubt about using the tag label . I have a div acting as a widget that simulates an advanced dropdown-list. <div class="control"> <label class="description">Choose:</label> <div class="widget__list">...some other content...</div> </div> Here the W3C specifications (http://www.w3.org/TR/html401/interact/forms.html#h-17.9) say: The LABEL element is used to specify labels for controls that do not have implicit labels (UPDATE: Please don't rely on the (outdated) quote above. Refer to

What's the best way to represent an empty TH in HTML5?

℡╲_俬逩灬. 提交于 2019-12-05 01:20:26
Say I have the given table: +------+------+------+ | Col1 | Col2 | Col3 | +------+------+------+------+ | Row1 | D1.1 | D1.2 | D1.3 | +------+------+------+------+ | Row2 | D2.1 | D2.2 | D2.3 | +------+------+------+------+ | Row3 | D3.1 | D3.2 | D3.3 | +------+------+------+------+ And I want to represent it in HTML5. The tricky thing is that tables like this must be semantically important, but the top-left cell is not semantically important, but instead a spacer to line up the more important column headers. What's the best way to do this? My first idea is to do it like this: <table> <thead>