Image Optimization <img>
All images can have a distinct filename and “alt” attribute, both of
which you should take advantage of. The “alt” attribute allows you to
specify alternative text for the image if it cannot be displayed for
some reason. Why use this attribute? If a user is viewing your site on a
browser that doesn’t support images, or is using alternative
technologies, such as a screen reader, the contents of the alt attribute
provide information about the picture.
Use brief, but descriptive filenames and alt text
Like many of the other parts of the page targeted for optimization,
filenames and alt text (for ASCII languages) are best when they’re
short, but descriptive. Use dashes in naming conventions versus
underscores (this-image.jpg vs. this_image.jpg). Also use relevant
keywords/key phrases in your alt text.
- Example:mickeymouse-stamp.jpg
- Avoid:
- Using generic filenames like “image1.jpg”, “pic.gif”, “1.jpg” when
possible (some sites with thousands of images might consider automating
the naming of images)
- Writing extremely lengthy filenames
- Never: Stuff keywords into alt text or copy and paste entire sentences
Supply alt text when using images as links
If you do decide to use an image as a link, filling out its alt text
helps search engines understand more about the page you’re linking to.
Imagine that you’re writing anchor text for a text link.
- Avoid: Using only image links for your site’s navigation
- Never: Writing excessively long alt text that would be considered spam
Store images in their own directory
Consider consolidating your images into a single directory (e.g.
leroysstampcollecting.com/images/). This simplifies the path to your
images.
- Do Not: Have image files spread out in numerous directories and subdirectories across your domain
Use commonly supported file types
Most browsers support JPEG, GIF, PNG, and BMP image formats. It’s
also a good idea to have the extension of your filename match with the
file type.
No comments:
Post a Comment