With this code:
<ul class="tabs-nav" role="tablist" >
<li role="tab">Latest News</li>
<li role="tab"><a href="#presspane" id="tab-press" >Press Releases</a></li>
</ul>
<div>
<div id="pane-newnews" role="tabpanel" aria-labelledby="tab-newnews" aria-hidden="false">
<p>Lorem</p>
</div>
<div id="pane-press" role="tabpanel" aria-labelledby="tab-press" aria-hidden="true">
<p>Ipsem</p>
</div>
</div>
I get this error on the W3C Validator:
"Bad value tablist for attribute role on element div"
I have turned over every rock in the documentation and find no reason this would not validate. Can anyone explain what I am doing wrong?
Thank you!
The W3C Validator is experimental a HTML5 checker and ARIA checking does not currently allow ARIA landmark roles.
See Steve Faulkner's post over at The Paciello Group Blog
You can use the W3C New Markup validation service to check for ARIA http://validator.w3.org/nu/ But note that ARIA is only conforming for use in HTML5, not that it makes any difference to whther it works or not. ARIA works equally well with any flavour of (X)HTML, its only the validtors that choke.
Related
Thanks in advance for any help here.
I have a sandbox and a live site that I'm making some minor tweaks to. There's one section that I just can't figure out what's causing the issue. Photos below.
Inside a li there's menu items that have a title, description and price. In some instances there's no price for the item and when that field is empty in the CMS the lines style themselves differently.
Here is the way I want it to appear: Live Site: https://www.crownshy.nyc/menus/#cocktails
cocktails page non-alc with no prices
The following is the way it's populating on the sandbox: https://crownshy-sandbox.getbento.com/menus/#cocktails
Sandbox cocktails page non-alc no prices
There's really nothing special about the code here, which is why I'm a bit confused. I just need to take a break and come back with a fresh eye but hoping you all can speed this along. I'm happy to post the CSS but figure because it's several classes that it would be easier to look at it on the developer console
<section class="menu-section">
<div class="menu-section__header">
<h2>Non-Alcoholic</h2>
</div>
<ul>
<li class="menu-item">
<p class="menu-item__heading">No Mas</p>
<p>Pear, Citrus, Rose, Lemon, Yogurt</p>
<p class="menu-item__details menu-item__details--price">
</p>
</li>
<li class="menu-item">
<p class="menu-item__heading">Ginger Jammer</p>
<p>Ginger, Mango, Togarashi, Lime, Soda</p>
<p class="menu-item__details menu-item__details--price">
</p>
</li>
<li class="menu-item">
<p class="menu-item__heading">Hojito</p>
<p>Hoja Santa, Lime, Tonic, Seasonal Herbs</p>
<p class="menu-item__details menu-item__details--price">
</p>
</li>
</ul>
</section>
On Sandbox the heading appears to be missing a width.
p.menu-item__heading {
width: 100%;
}
You put the style on span tag of on live site with this class name .menu-item__currency
You can use that class name or you can put a new tag and add float:left property with that class, I think then the issue will resolve.
I have an accordion which is structured like:
<section... role="tablist">
<div>
<h3 role="tab">Title</h3>
<div role="tabpanel">
...
</div>
</div>
</section>
Does tab have to be a direct child of the tablist to conform to wai aria best practices or is it okay to be wrapped in a div?
Authors MUST ensure elements with role tab are contained in, or owned by, an element with the role tablist.
https://www.w3.org/TR/wai-aria-1.1/#tab
Your example is therefore correct.
I would suggest you read through the spec to ensure you are following best ARIA practice.
For example adding the role on a div as opposed to a section element, as per the best practice example.
I have pages that will be crawled by the google and bing crawlers. One of the pages uses twitter bootstrap 2.3.2 Tabbable nav:
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active">Section 1</li>
<li>Section 2</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="tab1">
<p>I'm in Section 1</p>
</div>
<div class="tab-pane" id="tab2">
<p>Howdy, I'm in Section 2 and not currently visible. Will search engines ignore me?</p>
</div>
</div>
</div>
Since the content on the non active tabs is hidden I could see the search engines applying a significant penalty or discounting that content entirely when they crawl the site--not good news for the tabs since they will need to be removed.
In this link google warns about hiding text. and Matt Cutts says "I don’t recommend that people use CSS to hide text" so clearly you can get penalized for hiding text. However, engines may be smart enough to distinguish valid and invalid hiding.
Is my concern on hidden tabs warranted or do the search engines distinguish?
Googlebot crawler takes since last year js and css as stated by Matt Cutts in this video: http://www.youtube.com/watch?v=B9BWbruCiDc
To answer your question there is a fresh Matt Cutts video here youtube.com/watch?v=EsW8E4dOtR. What he says is that if you use js or css to hide content in a non-spammish way google will not take action against it and will consider your content just like any other content on your site.
I've put together this small little piece but I'm having problems with the renderings below IE9.
I've been going over a bunch of tutorials and have even tried a version of the "html shiv" technique, but to no avail.
I'm not sure what the problem is. I cross tested it and it works in pretty much every browser minus IE8 and below. I'm just curious if I'm going to have to rework an entire style sheet for the IE8 and less bunch or if I'm just missing something.
In IE8/IE7/IE6 the hover states for the buttons work, but it's as though all of the boundaries disappear.
http://www.brodieyazaki.com/matt_tiles
is a live working version.
Here's the HTML (I would include the CSS but it's long, but you can view it in developer tools sorry for the inconvenience).
<section id="tile">
<button id="toggle_button"></button>
<section id="tile_content">
<figure id="tile_content_figure" class="clearfix">
<img src="imgs/tile_pic.png">
<h1>
“Siri's Default Settings Leave
Your iPhone 4S Exposed”
</h1>
</figure>
<div id="tile_content_link">
<p id="from_in">
From nytimes.com in arab spring
</p>
</div>
<div id="tile_content_comment" class="clearfix">
<img src="imgs/user_img.png">
<p>
"This is the basic version of the tile"
</p>
</div>
</section>
<footer id="tile_foot">
<div id="foot_wrap" class="clearfix">
<figure class="like_view">
<img src="imgs/like.png">
<span>10</span>
</figure>
<figure class="like_view">
<img src="imgs/view.png">
<span>100</span>
</figure>
<article id="social" class="clearfix">
<button id="facebook"></button>
<button id="tumblr"></button>
<span>share</span>
</article>
</div>
</footer>
</section>
Just looking to get pointed in the right direction. I know that the CSS has features that IE8 and below won't pick up, but the head scratcher for me is that it's as though the style sheet in its entirety is broken.
please help, and thank you
< ie9 doesn't understand your html5 elements: article, footer, section, figure; offhand i'd just go ahead add html5.js and then turn them on in your css:
article,figure,section,footer{display:block}
i think that should fix what you are talking about
You have lots of duplicate id's. id's must be unique per element or a browser may ignore subsequent instances of the id. You should also declare a document encoding, among other HTML Validation errors...
http://validator.w3.org
Your site is more likely to work as expected, in all browsers, when its HTML code is fully compliant.
Lots of div and classes name are being used in the code.
http://www.csszengarden.com/
Is there any scope of improvement in semantic?
http://cssglobe.com/post/6957/class-names-revisited
this is mentioned in source code as a comment
This XHTML document is marked up to
provide the designer with the maximum
possible flexibility. There are more
classes and extraneous tags than
needed, and in a real world situation,
it's more likely that it would be
much leaner. However, I think we
can all agree that even given that,
we're still better off than if this
had been built with tables.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="author" content="Dave Shea" />
<meta name="keywords" content="design, css, cascading, style, sheets, xhtml, graphic design, w3c, web standards, visual, display" />
<meta name="description" content="A demonstration of what can be accomplished visually through CSS-based design." />
<meta name="robots" content="all" />
<title>css Zen Garden: The Beauty in CSS Design</title>
<!-- to correct the unsightly Flash of Unstyled Content. http://www.bluerobot.com/web/css/fouc.asp -->
<script type="text/javascript"></script>
<style type="text/css" title="currentStyle" media="screen">
#import "/001/001.css";
</style>
<link rel="Shortcut Icon" type="image/x-icon" href="http://www.csszengarden.com/favicon.ico" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.csszengarden.com/zengarden.xml" />
</head>
<body id="css-zen-garden">
<div id="container">
<div id="intro">
<div id="pageHeader">
<h1>
<span>css Zen Garden</span></h1>
<h2>
<span>The Beauty of <acronym title="Cascading Style Sheets">CSS</acronym> Design</span></h2>
</div>
<div id="quickSummary">
<p class="p1">
<span>A demonstration of what can be accomplished visually through <acronym title="Cascading Style Sheets">
CSS</acronym>-based design. Select any style sheet from the list to load it into
this page.</span></p>
<p class="p2">
<span>Download the sample <a href="/zengarden-sample.html" title="This page's source HTML code, not to be modified.">
html file</a> and <a href="/zengarden-sample.css" title="This page's sample CSS, the file you may modify.">
css file</a></span></p>
</div>
<div id="preamble">
<h3>
<span>The Road to Enlightenment</span></h3>
<p class="p1">
<span>Littering a dark and dreary road lay the past relics of browser-specific tags,
incompatible <acronym title="Document Object Model">DOM</acronym>s, and broken <acronym
title="Cascading Style Sheets">CSS</acronym> support.</span></p>
<p class="p2">
<span>Today, we must clear the mind of past practices. Web enlightenment has been achieved
thanks to the tireless efforts of folk like the <acronym title="World Wide Web Consortium">
W3C</acronym>, <acronym title="Web Standards Project">WaSP</acronym> and the
major browser creators.</span></p>
<p class="p3">
<span>The css Zen Garden invites you to relax and meditate on the important lessons
of the masters. Begin to see with clarity. Learn to use the (yet to be) time-honored
techniques in new and invigorating fashion. Become one with the web.</span></p>
</div>
</div>
<div id="supportingText">
<div id="explanation">
<h3>
<span>So What is This About?</span></h3>
<p class="p1">
<span>There is clearly a need for <acronym title="Cascading Style Sheets">CSS</acronym>
to be taken seriously by graphic artists. The Zen Garden aims to excite, inspire,
and encourage participation. To begin, view some of the existing designs in the
list. Clicking on any one will load the style sheet into this very page. The code
remains the same, the only thing that has changed is the external .css file. Yes,
really.</span></p>
<p class="p2">
<span><acronym title="Cascading Style Sheets">CSS</acronym> allows complete and total
control over the style of a hypertext document. The only way this can be illustrated
in a way that gets people excited is by demonstrating what it can truly be, once
the reins are placed in the hands of those able to create beauty from structure.
To date, most examples of neat tricks and hacks have been demonstrated by structurists
and coders. Designers have yet to make their mark. This needs to change.</span></p>
</div>
<div id="participation">
<h3>
<span>Participation</span></h3>
<p class="p1">
<span>Graphic artists only please. You are modifying this page, so strong <acronym
title="Cascading Style Sheets">CSS</acronym> skills are necessary, but the example
files are commented well enough that even <acronym title="Cascading Style Sheets">CSS</acronym>
novices can use them as starting points. Please see the <a href="http://www.mezzoblue.com/zengarden/resources/"
title="A listing of CSS-related resources"><acronym title="Cascading Style Sheets">CSS</acronym>
Resource Guide</a> for advanced tutorials and tips on working with <acronym title="Cascading Style Sheets">
CSS</acronym>.</span></p>
<p class="p2">
<span>You may modify the style sheet in any way you wish, but not the <acronym title="HyperText Markup Language">
HTML</acronym>. This may seem daunting at first if you’ve never worked this
way before, but follow the listed links to learn more, and use the sample files
as a guide.</span></p>
<p class="p3">
<span>Download the sample <a href="/zengarden-sample.html" title="This page's source HTML code, not to be modified.">
html file</a> and <a href="/zengarden-sample.css" title="This page's sample CSS, the file you may modify.">
css file</a> to work on a copy locally. Once you have completed your masterpiece
(and please, don’t submit half-finished work) upload your .css file to a web
server under your control. <a href="http://www.mezzoblue.com/zengarden/submit/" title="Use the contact form to send us your CSS file">
Send us a link</a> to the file and if we choose to use it, we will spider the
associated images. Final submissions will be placed on our server.</span></p>
</div>
<div id="benefits">
<h3>
<span>Benefits</span></h3>
<p class="p1">
<span>Why participate? For recognition, inspiration, and a resource we can all refer
to when making the case for <acronym title="Cascading Style Sheets">CSS</acronym>-based
design. This is sorely needed, even today. More and more major sites are taking
the leap, but not enough have. One day this gallery will be a historical curiosity;
that day is not today.</span></p>
</div>
<div id="requirements">
<h3>
<span>Requirements</span></h3>
<p class="p1">
<span>We would like to see as much <acronym title="Cascading Style Sheets, version 1">
CSS1</acronym> as possible. <acronym title="Cascading Style Sheets, version 2">CSS2</acronym>
should be limited to widely-supported elements only. The css Zen Garden is about
functional, practical <acronym title="Cascading Style Sheets">CSS</acronym> and
not the latest bleeding-edge tricks viewable by 2% of the browsing public. The only
real requirement we have is that your <acronym title="Cascading Style Sheets">CSS</acronym>
validates.</span></p>
<p class="p2">
<span>Unfortunately, designing this way highlights the flaws in the various implementations
of <acronym title="Cascading Style Sheets">CSS</acronym>. Different browsers display
differently, even completely valid <acronym title="Cascading Style Sheets">CSS</acronym>
at times, and this becomes maddening when a fix for one leads to breakage in another.
View the <a href="http://www.mezzoblue.com/zengarden/resources/" title="A listing of CSS-related resources">
Resources</a> page for information on some of the fixes available. Full browser
compliance is still sometimes a pipe dream, and we do not expect you to come up
with pixel-perfect code across every platform. But do test in as many as you can.
If your design doesn’t work in at least IE5+/Win and Mozilla (run by over
90% of the population), chances are we won’t accept it.</span></p>
<p class="p3">
<span>We ask that you submit original artwork. Please respect copyright laws. Please
keep objectionable material to a minimum; tasteful nudity is acceptable, outright
pornography will be rejected.</span></p>
<p class="p4">
<span>This is a learning exercise as well as a demonstration. You retain full copyright
on your graphics (with limited exceptions, see <a href="http://www.mezzoblue.com/zengarden/submit/guidelines/">
submission guidelines</a>), but we ask you release your <acronym title="Cascading Style Sheets">
CSS</acronym> under a Creative Commons license identical to the <a href="http://creativecommons.org/licenses/by-nc-sa/1.0/"
title="View the Zen Garden's license information.">one on this site</a>
so that others may learn from your work.</span></p>
<p class="p5">
<span>Bandwidth graciously donated by mediatemple.
Now available: <a href="https://rads.stackoverflow.com/amzn/click/com/0321303474" rel="nofollow noreferrer">
Zen Garden, the book</a>.</span> </p>
</div>
<div id="footer">
<a href="http://validator.w3.org/check/referer" title="Check the validity of this site’s XHTML">
xhtml</a> <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Check the validity of this site’s CSS">
css</a> <a href="http://creativecommons.org/licenses/by-nc-sa/1.0/" title="View details of the license of this site, courtesy of Creative Commons.">
cc</a> <a href="http://mezzoblue.com/zengarden/faq/#s508" title="Read about the accessibility of this site">
508</a> <a href="http://www.mezzoblue.com/zengarden/faq/#aaa" title="Read about the accessibility of this site">
aaa</a>
</div>
</div>
<div id="linkList">
<div id="linkList2">
<div id="lselect">
<h3 class="select">
<span>Select a Design:</span></h3>
<ul>
<li><a href="?cssfile=/213/213.css&page=0" title="AccessKey: a" accesskey="a">Under
the Sea!</a> by Eric Stoltz</li>
<li><a href="?cssfile=/212/212.css&page=0" title="AccessKey: b" accesskey="b">Make
’em Proud</a> by <a href="http://skybased.com/" class="c">Michael McAghon and
Scotty Reifsnyder</a></li>
<li><a href="?cssfile=/211/211.css&page=0" title="AccessKey: c" accesskey="c">Orchid
Beauty</a> by Kevin Addison</li>
<li>Oceanscape
by Justin Gray</li>
<li><a href="?cssfile=/209/209.css&page=0" title="AccessKey: e" accesskey="e">CSS
Co., Ltd.</a> by Benjamin Klemm</li>
<li>Sakura
by Tatsuya Uchida</li>
<li><a href="?cssfile=/207/207.css&page=0" title="AccessKey: g" accesskey="g">Kyoto
Forest</a> by John Politowski</li>
<li><a href="?cssfile=/206/206.css&page=0" title="AccessKey: h" accesskey="h">A
Walk in the Garden</a> by <a href="http://users.skynet.be/bk316398/temp.html" class="c">
Simon Van Hauwermeiren</a></li>
</ul>
</div>
<div id="larchives">
<h3 class="archives">
<span>Archives:</span></h3>
<ul>
<li><a href="/?cssfile=/001/001.css&page=1" title="View next set of designs. AccessKey: n"
accesskey="n"><span class="accesskey">n</span>ext designs »</a></li>
<li><a href="http://www.mezzoblue.com/zengarden/alldesigns/" title="View every submission to the Zen Garden. AccessKey: w"
accesskey="w">Vie<span class="accesskey">w</span> All Designs</a></li>
</ul>
</div>
<div id="lresources">
<h3 class="resources">
<span>Resources:</span></h3>
<ul>
<li><a href="/001/001.css" title="View the source CSS file for the currently-viewed design, AccessKey: v"
accesskey="v"><span class="accesskey">V</span>iew This Design’s <acronym title="Cascading Style Sheets">
CSS</acronym></a></li>
<li><a href="http://www.mezzoblue.com/zengarden/resources/" title="Links to great sites with information on using CSS. AccessKey: r"
accesskey="r"><acronym title="Cascading Style Sheets">CSS</acronym> <span class="accesskey">
R</span>esources</a></li>
<li><a href="http://www.mezzoblue.com/zengarden/faq/" title="A list of Frequently Asked Questions about the Zen Garden. AccessKey: q"
accesskey="q"><acronym title="Frequently Asked Questions">FA<span class="accesskey">Q</span></acronym></a></li>
<li><a href="http://www.mezzoblue.com/zengarden/submit/" title="Send in your own CSS file. AccessKey: s"
accesskey="s"><span class="accesskey">S</span>ubmit a Design</a></li>
<li><a href="http://www.mezzoblue.com/zengarden/translations/" title="View translated versions of this page. AccessKey: t"
accesskey="t"><span class="accesskey">T</span>ranslations</a></li>
</ul>
</div>
</div>
</div>
</div>
<!-- These extra divs/spans may be used as catch-alls to add extra imagery. -->
<div id="extraDiv1">
<span></span>
</div>
<div id="extraDiv2">
<span></span>
</div>
<div id="extraDiv3">
<span></span>
</div>
<div id="extraDiv4">
<span></span>
</div>
<div id="extraDiv5">
<span></span>
</div>
<div id="extraDiv6">
<span></span>
</div>
</body>
</html>
The big comment kinda answers your question. The CSS Zen Garden is built as a novelty with tons of no-semantic-value tags and attributes to allow for infinite stylings. It's not meant as a model of how a real webpage should organize itself.
Using this sort of HTML in parts of your document where it's necessary is fine, since you're in charge of the CSS. Don't use this kind of markup where you don't need it, but it's perfectly acceptable in small amounts. The Zen Garden just puts it everywhere, just in case.