Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

aria-hidden="true"

LEGEND ,
Dec 12, 2016 Dec 12, 2016

Hey there,

Seems that when DW reports checks for missing alt tags it shows an error/caution on ever Font Awesome icon. Since I only build internal dashboard applications I do not need title or alt tags on every icon. Don't need them on any of them at all actually.

I know I can add aria-hidden="true" to the <I> tag but I have to do it to every single on and I use a lot of them.

So my question is; is there a way to add it globally or even page level in the head or CSS file so that alt tags are ignored on all icon tags rather than having to add it to each tag?

1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2016 Dec 12, 2016

Basically I am trying to avoid reports like this without having to add the attribute to each and every font awesome icon ...

Screen Shot 2016-12-12 at 10.26.49 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 12, 2016 Dec 12, 2016

I use a lot of FontAwesome icons too and I don't have any warnings about them in DW.  Nothing shows up about them in Site Reports, Output or Validator.

Example:

<i class="fa fa-balance-scale fa-2x"></i>

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 12, 2016 Dec 12, 2016

Thanks Nancy,

I wonder if there is a setting in the validation settings in the preference panel. I get the warnings every time if I don't add the attribute to each one. I'll look into that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2016 Dec 13, 2016

The validator uses the W3C algorithm and pulls directly from their website, it's not an internal validation system within DW, so there aren't any preferences you can set.

Italic tags, in and of themselves, don't require an alt attribute under any html doctype that I've ever seen.

What is the full code of one of your <i></i> tagsets that throws the error?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2016 Dec 13, 2016

In 2017 Preferences, filter errors & warnings.  See below.

The whole issue of whether to use <i>, <span> or <img> tags gets a little blurry. See link below for a good discussion about it.

html - Should I use <i> tag for icons instead of <span>? - Stack Overflow

Nancy

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2016 Dec 13, 2016

The Filter settings don't do anything in either CC2015 or CC2017 for me.

Items on the hidden list still come up in both the Site Report and the Validation windows.

Even unchecking both the error and warning boxes doesn't stop them from coming up in the Site Report, the validation window will be empty though.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 13, 2016 Dec 13, 2016

Jon Fritz II wrote:

What is the full code of one of your <i></i> tagsets that throws the error?

<i class="fa fa-pencil" aria-hidden="true"></I> = No Error

<i class="fa fa-pencil"></I> = Error

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2016 Dec 13, 2016

Weird, alt is not a required attribute in <i> tagsets. I also do not get the error while using the same code.

Looks like DW is getting confused by something.

Are you using something other than the HTML5 doctype ( <!doctype html> ) on the first line of the page?
Are there any structural errors (like unclosed elements) in your html?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 13, 2016 Dec 13, 2016
LATEST

It is weird.  I can't reproduce it either.  Win10, 64-bit.

Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines