Front-End Checklist
github.com
github.com
Please don't do that. Don't put an alt on ALL images. Screen readers will read all of them. Skin and flavour images don't deserve to be read outloud. Nobody wants to hear "bottom left corner of logo" or "rounded corner".
<img src=".." alt="">
Do you mean like that? Empty quotes and it would not be read?Let's see. If we use an image that doesn't add anything to the content, one would normally use background-attachment to add an image to say, the hero section.
(It seems you edited your comment?)
Good to know that the screen reader would try to read the file name if there isn't any alt text in it, I didn't know that. So, in the cases we do need to place an img in the document, then we simple place an empty alt text as in my above comment to tell the screen reader not to read the file name since it is only used for decorative purposes...?
Edit: I confused your comment with another one.
> give it an empty alt attribute to indicate to the screen reader that it shouldn’t try to read out the file name or something
Imagine reading a printed text page about dogs and peppered throughout the text was mentions of 'bezel flare 2' or similar. If it doesn't make sense for that to be on the page as text alone then it shouldn't be on the page at all.
Actually the meta viewport "Helps Google’s algorithms accurately assign indexing properties to the page rather than needing to signal the existence of corresponding desktop/mobile pages." [1]
Every bit of code on a page is interpreted a certain way for a reason. HTML5 now has more semantic tags like header and nav that add an additional layer of certainty over context. I'll concede that most developers seem to not care about the reasons why so long as they can push code to production faster.
[1] https://developers.google.com/search/mobile-sites/mobile-seo...
Should you add an alt to a stock photo?
Should you disturb a user with a reading of "stock photo of a business man smiling" next to a sales paragraph? What about "sunset over a mountain" on a page for a SaaS website?
The goal is not so much to make the best experience for the assistive technology user but to provide as close to the same experience as possible, bullshit marketing crap and all.
I would assume front-end guys care more about passing a Web Accessibility[0] audit than inconveniencing some users, thus good taste and wise discretion is spared for avoidance of litigation.
A good example is an image used as an icon next to a text label. Imagine a link/button that contains the words "Save" and a floppy disk icon. There's no need to have an alt of "Save" on the icon as the text "Save" is already present. So it would look something like this:
<a href="#"><img src="save-icon.png" aria-hidden="true">Save</a>
Though in this case you'd probably be using an icon font like FontAwesome.[1] https://stackoverflow.com/questions/31107040/whats-the-diffe...
'aria-hidden' is for HTML elements that don't have their own way of hiding themselves from assistive technologies and for cases where you'll use JavaScript to change the element's hidden state. I can't think of a situation where you'd want to conditionally show and hide only an image only from screen readers but if you had that situation, toggling aria-hidden would be better than adding and removing the alt attribute's value.
<!doctype html>
<html lang="en">
<title>My Title</title>
<div id="main"></div>
Also note that the html tag can also be omitted, unless you need to set the language. Don't worry about closing it either.---
Original comment:
The fact that browsers are able to handle malformed HTML doesn't mean that you should do it that way. There's no meaningful benefit that I can think of, and the potential to break a ton of things that aren't as lenient.
>An html element's start tag can be omitted if the first thing inside the html element is not a comment.
>An html element's end tag can be omitted if the html element is not immediately followed by a comment.
For example, your site certainly won't break from missing the 'lang' attribute.
Your site isn't "broken", per se, but it's not as high quality as it could be.
Update: from elsewhere on this thread, Google ignores <html lang>:
> But the language attribute within the HTML markup is something we don't use at all. We've found that this language markup is something that is almost always wrong. So we tend to ignore that.
https://www.seroundtable.com/google-ignores-the-html-lang-at...
FWIW, Chrome's translate feature does care about lang=. Or at least it did last time I checked.
It's one of the things that has no downside, and a small upside. If you leave it out, your site isn't horribly broken. People will always get the content, but tools that process the content might be wrong.
One would be better off just using the Google Web Starter kit[1], other boilerplate options, or just chrome dev tools running Audits to get started with a solid front-end.
I've helped a friend to publish a one-page website over the weekend, and I believe it follows most of this checklist
https://github.com/thedaviddias/Front-End-Checklist/issues/2...
So what unit should be used?
(They generally assume these values are in pixels by default[1])
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/im...
why?
<html lang="en">
tough, I don't know what the difference is.2. I’d be surprised if search engines didn’t use it at least as a flag for content language (although I’m sure that it‘s only supplemental at best).
3. Styling based on language. CSS has a :lang() pseudoclass selector so you can do p:lang(en) { color: red; } p:lang(fr) { color: blue; } . Or tie quote styles to language based on generated content. Or most usefully adjust font metrics based on language for multilingual sites (typically you’d want to boost the font size a little for Chinese or Japanese as there are less characters for same information, but each character is a little more dense).
[1] https://www.w3.org/International/tests/repo/results/the-lang...
[2] http://accessibility.psu.edu/foreignlanguages/langtaghtml/#a...
[3] https://www.seroundtable.com/google-ignores-the-html-lang-at...
What is this 2004?
https://support.google.com/webmasters/answer/7424835?hl=en#h...
> robots.txt Disallow does not guarantee that a page will not appear in results: Google may still decide, based on external information such as incoming links, that it is relevant. If you wish to explicitly block a page from being indexed, you should instead use the noindex robots meta tag or X-Robots-Tag HTTP header.
If it's something like a staging site, you'd be better putting it behind a login screen to prevent mistakes anyway.
crawling != indexing
with a segmented sitemap (i.e.: one per pagetype, per namespace, ..) you get important communicated to indexed ratios you otherwise do not get.
if crawling and indexing works, it works but if it doesn't you should know it (see it in google search console) and debug it (narrow it down via segmented sitemaps).
If you're using wordpress or another pre-baked system, then it's worth having a sitemap plugin (example: Yoast SEO) or the built-in sitemap (like for Shopify).
Submit it to Google Search Console, Bing, and you're done (essentially).
Even though its Apple, at some point its not worth spending the time and money.