<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amanda Hasenzahl</title>
    <description>The latest articles on DEV Community by Amanda Hasenzahl (@alhasenzahl).</description>
    <link>https://dev.to/alhasenzahl</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F151364%2F24d8801b-300a-4ef2-859d-2f08b91e3eac.jpg</url>
      <title>DEV Community: Amanda Hasenzahl</title>
      <link>https://dev.to/alhasenzahl</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alhasenzahl"/>
    <language>en</language>
    <item>
      <title>Functional Programming: The Basics</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Tue, 03 Nov 2020 15:14:22 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/functional-programming-the-basics-4n7</link>
      <guid>https://dev.to/alhasenzahl/functional-programming-the-basics-4n7</guid>
      <description>&lt;p&gt;In computer science, functional programming is a programming paradigm -- a way of thinking about software construction based on a set of fundamental, defining principles.&lt;/p&gt;

&lt;p&gt;The fundamental, defining principles that make up this paradigm are that the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;follows a declarative pattern&lt;/li&gt;
&lt;li&gt;is composed of pure functions&lt;/li&gt;
&lt;li&gt;avoids shared state, mutable data, and side effects&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Imperative vs Declarative Pattern
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Imperative Pattern
&lt;/h3&gt;

&lt;p&gt;When the computer is given specific steps in order to achieve a desired result -- telling the computer exactly HOW to do something.&lt;/p&gt;

&lt;p&gt;This tends to be the pattern that developers follow most often.  It is the way that, we as humans, are used to trying to solve a problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Declarative Pattern
&lt;/h3&gt;

&lt;p&gt;When the computer is given instructions on what result is desired without telling it exactly how it is to be done -- telling the computer WHAT needs to be done.&lt;/p&gt;

&lt;p&gt;This is the way that functional programmers approach solving a problem.  They focus on what results they need, rather than how the results are achieved.  It is a different approach that can be hard to adopt at first, but can do significant things for your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi5au98s6kg3zub4w9z64.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi5au98s6kg3zub4w9z64.png" alt="Using a for loop and the imperative pattern vs. using Array.prototype.map() and the declarative pattern&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Both of these examples are adding new items onto each book object inside the books array.&lt;/p&gt;

&lt;p&gt;The for loop example (Imperative Pattern):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It’s checking array index counter against the array length&lt;/li&gt;
&lt;li&gt;Adding a &lt;code&gt;lastRead&lt;/code&gt; property to the books object with the current date as the value for the currently indexed book.&lt;/li&gt;
&lt;li&gt;Incrementing the index counter for every time through the loop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It’s giving the computer a step by step instruction for how to add these new items&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.map()&lt;/code&gt; example (Declarative Pattern):&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Takes a function as an argument&lt;/li&gt;
&lt;li&gt;That function receives each item as a parameter&lt;/li&gt;
&lt;li&gt;Adds a &lt;code&gt;lastReadBy&lt;/code&gt; property to each book with a string value of &lt;code&gt;'me'&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It’s giving the computer the information to produce the desired result, but it is not telling it exactly how to do it. The &lt;code&gt;.map()&lt;/code&gt; method behind the scenes is taking care of the actual operation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pure Functions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;accept at least one parameter&lt;/li&gt;
&lt;li&gt;return something as a result&lt;/li&gt;
&lt;li&gt;return the same output if given the same input&lt;/li&gt;
&lt;li&gt;produce no side effects&lt;/li&gt;
&lt;li&gt;are referentially transparent -- you can replace the function call with its resulting value without changing the meaning of the program&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They are also simple and reusable building blocks for your code, completely independent from outside state therefore immune to state related bugs, as well as being easy to move around, refactor, and reorganize within your code.  Thus making your overall program more flexible and adaptable to future changes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9duw0fh1ob07o8xt3214.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F9duw0fh1ob07o8xt3214.png" alt="Pure function that returns the sum of two given parameters"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is an example of a pure function.  It accepts at least one parameter and returns a value.  When it's given the values of 3 and 5, it will always return the output value of 8.  It produces no side effects because the function relies on nothing except its input values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhm59ropjlo4lp0cw9kll.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhm59ropjlo4lp0cw9kll.png" alt="A pure function call being replaced by its output as an example of referential transparency"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This example shows a pure function and more specifically how they can be referentially transparent.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;add(x, y)&lt;/code&gt; function is taking in two values and producing their added sum as an output, which in this case is 8.  Then, we have the &lt;code&gt;multiply(a, b)&lt;/code&gt; function that is also taking in two values, but this time is producing their multiplied total as an output.&lt;/p&gt;

&lt;p&gt;Using both functions we could write this function call as the first call &lt;code&gt;multiply(2, add(3, 5));&lt;/code&gt;.  Which would first add 3 to 5, producing the sum of 8.  That sum of 8 would be passed as a parameter to &lt;code&gt;multiply()&lt;/code&gt; along with 2, to produce the value of 16 as the final output.&lt;/p&gt;

&lt;p&gt;We could also change the &lt;code&gt;add(3, 5)&lt;/code&gt; function call as a parameter to just the value of its output (8).  This change still produces the output value of 16.  This replacement didn’t affect the output of the function in anyway, which makes it referentially transparent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Immutability and Side Effects
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Immutability
&lt;/h3&gt;

&lt;p&gt;When an object cannot be modified in any way after it has been created.&lt;/p&gt;

&lt;p&gt;The goal is to keep state and data from being shared or altered and solely keep it within the scope of each function, when possible.  &lt;/p&gt;

&lt;p&gt;There are no variable or loops, at least not how we are used to seeing them.  Stored values are called variables because of history, but they are constants.  Once &lt;code&gt;x&lt;/code&gt; takes on a value, it is that value for life.  They are usually local variables, so their lives are usually short, but while it is alive it can never change.  Loops, on the other hand, happen through recursion.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;One thing to keep in mind is that in JavaScript, the variable &lt;code&gt;const&lt;/code&gt; doesn't necessarily equal immutability.  &lt;code&gt;const&lt;/code&gt; creates a variable name binding which cannot be reassigned after creation, however, it doesn't create immutable objects.  You can't change the object that the binding refers to, but you can still change the properties of the object.  This ultimately means that bindings created with &lt;code&gt;const&lt;/code&gt; are mutable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Recursion&lt;/strong&gt; is when a function calls or refers to itself.  This is used in place of traditional loops.  Old values aren't modified during the looping, instead recursion uses new values calculated from the old ones.  This allows constants and data to be modified as little as possible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd1choispsde2f5d9hjcc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd1choispsde2f5d9hjcc.gif" alt="Flip book of a meteor striking Earth and killing the dinosaurs"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recursion is like a flip book.  Each instance would be like each individual page of the flip book.  They are completely independent of each other, don't modify anything on any of the other pages, and putting each instance together gives you the final result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5bmmcx9wqo9727l2w39u.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5bmmcx9wqo9727l2w39u.gif" alt="Blocks moving across a conveyer belt on an assembly line"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Traditional loops are more like an assembly line.  Each part of the process molds or changes the object until you get the final result.  Each part is reliant on the one that comes before and after it and the final result is reliant on each part of the process and the order in which they are completed in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftzro5blq1az68zcrnxhv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftzro5blq1az68zcrnxhv.png" alt="A function that finds factorials using recursion"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are three key features in a recursion function.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Termination Case &lt;br&gt;
It stops the function from happening infinitely.  It is the emergency brake and is used to break out of the logic if you have reached the end of the input or if there is a bad input and you don’t want the code to run at all (in this example a negative number because there aren’t factorials for negative numbers).  The termination case for this example is &lt;code&gt;x &amp;lt; 0&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Base Case&lt;br&gt;
Similar to the termination case, it is also used to stop the recursion from continuing.  Base case however, is the goal of the function.  In this example, &lt;code&gt;x === 0&lt;/code&gt; is the base case because once &lt;code&gt;x&lt;/code&gt; has gotten down to 0, the factorial has been found and the recursion doesn’t need to go any further.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; In some functions, you will only see a base case instead of a base case and a termination case.  This would be because the base case and the termination case are the same or can be taken care of in one single call.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Recursion
The function repeatedly calling itself until it reaches its base case.  In this example, that is &lt;code&gt;return x * factorial(x - 1);&lt;/code&gt;. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsghp6syqotbpwxyvrcsy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fsghp6syqotbpwxyvrcsy.png" alt="Step by step breakdown of the factorials recursion function with 3 as an input"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This example breaks down as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We are calling the function and passing it the value of 3 → &lt;code&gt;factorial(3);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The function is run and since 3 is greater than 0, the function returns &lt;code&gt;3 * factorial(3-1)&lt;/code&gt; OR &lt;code&gt;3 * factorial(2)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The function is run again with the value of 2 → &lt;code&gt;factorial(2);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Again 2 is greater than 0, so the function returns &lt;code&gt;2 * factorial(2-1)&lt;/code&gt; OR &lt;code&gt;2 * factorial(1)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;The function is then run again with the value of 1 → &lt;code&gt;factorial(1)&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;Once again it is greater than 0, so the function returns &lt;code&gt;1 * factorial(1-1)&lt;/code&gt; OR &lt;code&gt;1 * factorial(0)&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;When the function is run another time with the value of 0, the base case becomes true, so the function returns the value of 1 (&lt;code&gt;if (x === 0) return 1&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Now that the function has finally finished, everything unwinds.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IMPORTANT&lt;/strong&gt; -- Recursion is a group of nested function calls, so the innermost function will return first (Last One In, First One Out)&lt;/li&gt;
&lt;li&gt;Everything unwinds in the order shown at bottom of the image above&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Side Effects
&lt;/h3&gt;

&lt;p&gt;Any application state changes that are observable outside the called function other than its return value.&lt;/p&gt;

&lt;p&gt;Elements in your code that can cause side effects are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;modifying any external variable or object property&lt;/li&gt;
&lt;li&gt;logging to the console&lt;/li&gt;
&lt;li&gt;writing to the screen, a file, or the network&lt;/li&gt;
&lt;li&gt;triggering any external process&lt;/li&gt;
&lt;li&gt;calling other functions that contain side effects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unfortunately, you can’t have a program or code base that is completely 100% free from side effects, but you can work to keep them contained and isolated within your code.  This makes it easier to extend, refactor, debug, test, and maintain your code.  It is also why front end frameworks encourage users to manage state and component renderings in separate, loosely coupled modules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shared State&lt;/strong&gt; is something that will create side effects within your code if it is altered.  &lt;/p&gt;

&lt;p&gt;One reason for this is because it is impossible to know the entire history of every shared variable, especially if there are asynchronous calls happening within your code.&lt;/p&gt;

&lt;p&gt;An example of this would be if there was a user object for your program that needed to be saved.  The &lt;code&gt;saveUser()&lt;/code&gt; function makes a request to the API on the server and while that is happening, the user changes their profile picture with the &lt;code&gt;updateAvatar()&lt;/code&gt; function.  This triggers a second request with &lt;code&gt;saveUser()&lt;/code&gt;.  Since these are async calls, if the second call is received first, when the first call (now outdated) call gets returned, the new profile picture will get deleted and replaced with the old one.  &lt;/p&gt;

&lt;p&gt;This is an example of a race condition, which is a common bug with having shared state.  During that entire process there are times when you don't know what's happening to the user object.  Therefore, sometimes you receive a result you weren't expecting.&lt;/p&gt;

&lt;p&gt;Another reason is because when the order of the functions changes or they get moved around it causes a cascade of failures within your code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fze2a10wowe2x1qs8tbkv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fze2a10wowe2x1qs8tbkv.png" alt="Two functions with the same values and operations result in two different outputs when executed in a different order"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The first half of this example is taking the value in &lt;code&gt;x&lt;/code&gt; and first executing the &lt;code&gt;x1()&lt;/code&gt; function which adds 1 to make &lt;code&gt;x.val = 3&lt;/code&gt;.  Then it is executing &lt;code&gt;x2()&lt;/code&gt; which is multiplying that by 2 to make &lt;code&gt;x.val = 6&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The second half is the exact same values and functions as the first, however the two functions get called in reverse.  It starts with the value of 2, then it multiplies that by 2 to get 4, and then it adds 1 to that.  This gives you a final result of 5.&lt;/p&gt;

&lt;p&gt;Changing the order of the function calls on the exact same value, produced two different resulting values.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Functional programming is a way to approach solving software challenges based on a set of fundamental, defining principles: follows a declarative pattern, utilizes pure functions, and avoids using shared state, mutable data, as well as creating side effects.
&lt;/li&gt;
&lt;li&gt;The declarative pattern entails giving the computer what you are wanting as a result without telling it exactly how it needs to be done.
&lt;/li&gt;
&lt;li&gt;Pure functions are simple reusable blocks of code that are completely independent from any outside state.  They are immune to bugs related to state changes and help make your code flexible to future changes because they are easy to move around and refactor.&lt;/li&gt;
&lt;li&gt;Shared state, mutable data, and side effects are avoided as much as possible.  Although, a program can never be completely free of side effects, the goal is to keep them contained and isolated inside your code.&lt;/li&gt;
&lt;li&gt;Adopting a functional programming approach in the right situations has potential to take your code to the next level &lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Image Accessibility 101: Image Maps</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:29:23 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-image-maps-2kc6</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-image-maps-2kc6</guid>
      <description>&lt;p&gt;An image map is an image that contains clickable regions.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for writing the alt text:
&lt;/h2&gt;

&lt;p&gt;1) This type of image also requires a two part description, one for the entire image and another for each clickable region.&lt;/p&gt;

&lt;p&gt;2) Inside the image's alt attribute is where the basic description for the entire image would go.&lt;/p&gt;

&lt;p&gt;3) Each clickable region is also given its own alt attribute, which would contain a description of what will happen or where they will be taken when they click on that region of the image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fugjjhrqc0b3jfpjmqqp8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fugjjhrqc0b3jfpjmqqp8.png" alt="Organizational chart that shows relationships amongst employees at a company."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; 
    &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/orgchart-b583d8ff.png"&lt;/span&gt; 
    &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Board of directors and related staff: "&lt;/span&gt; 
    &lt;span class="na"&gt;usemap=&lt;/span&gt;&lt;span class="s"&gt;"#Map"&lt;/span&gt; 
&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;map&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"Map"&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"Map"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;area&lt;/span&gt;
        &lt;span class="na"&gt;shape=&lt;/span&gt;&lt;span class="s"&gt;"rect"&lt;/span&gt;
        &lt;span class="na"&gt;coords=&lt;/span&gt;&lt;span class="s"&gt;"176,14,323,58"&lt;/span&gt;
        &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"chairman.html"&lt;/span&gt;
        &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Davy Jones: Chairman"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;area&lt;/span&gt; 
        &lt;span class="na"&gt;shape=&lt;/span&gt;&lt;span class="s"&gt;"rect"&lt;/span&gt; 
        &lt;span class="na"&gt;coords=&lt;/span&gt;&lt;span class="s"&gt;"81,75,226,114"&lt;/span&gt; 
        &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"secretary.html"&lt;/span&gt;
        &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Carole Brewster: Company Secretary"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;area&lt;/span&gt; 
        &lt;span class="na"&gt;shape=&lt;/span&gt;&lt;span class="s"&gt;"rect"&lt;/span&gt; 
        &lt;span class="na"&gt;coords=&lt;/span&gt;&lt;span class="s"&gt;"6,138,155,182"&lt;/span&gt; 
        &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"marketing-director.html"&lt;/span&gt;
        &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Henry H Brown: Marketing Director (reports to chairman)"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;area&lt;/span&gt; 
        &lt;span class="na"&gt;shape=&lt;/span&gt;&lt;span class="s"&gt;"rect"&lt;/span&gt;
        &lt;span class="na"&gt;coords=&lt;/span&gt;&lt;span class="s"&gt;"175,138,323,182"&lt;/span&gt;
        &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"sales-director.html"&lt;/span&gt;
        &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Paula Holbein: Sales Director (reports to chairman)"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;area&lt;/span&gt;
        &lt;span class="na"&gt;shape=&lt;/span&gt;&lt;span class="s"&gt;"rect"&lt;/span&gt; 
        &lt;span class="na"&gt;coords=&lt;/span&gt;&lt;span class="s"&gt;"345,136,496,186"&lt;/span&gt; 
        &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"finance-director.html"&lt;/span&gt;
        &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Hugh Howard: Finance Director (reports to chairman)"&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/map&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above example is of a company's organizational chart that shows all the people by name, position, and how their roles are related to each other.  In the image, the regions for each person in the chart is a clickable element that would bring the user to that person's biography. &lt;/p&gt;

&lt;p&gt;The image's first alt text explains that the image is an organizational chart for a company's board of directors and related staff, while each clickable region relays to the user that person's name, role, and if they report to anyone.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Image maps are images that contain clickable regions.  These images also need a two part description: one for the entire image as a whole and a second for each clickable area inside the image.  The descriptions given to each clickable region should explain what will occur or where they will go when they click on the link.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Image Accessibility 101: Complex Images</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:29:11 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-complex-images-3en1</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-complex-images-3en1</guid>
      <description>&lt;p&gt;A complex image is an image that portrays detailed information.  These images would include graphs, diagrams, illustrations, weather maps, or any other image that cannot be summed up in a short phrase or sentence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for writing the alt text:
&lt;/h2&gt;

&lt;p&gt;1) This type of image requires two separate descriptions: one for the image itself and a longer description explaining the data and information being portrayed by the image.&lt;/p&gt;

&lt;p&gt;2) The basic description for the image goes inside the image's alt attribute.&lt;/p&gt;

&lt;p&gt;3) The long description needs to be available elsewhere either in the content on the same page as the image or through an associated link to another page.&lt;/p&gt;

&lt;p&gt;4) There are a couple of different ways to approach the long description aspect for this type of image.  I will discuss each one below and explain the pros and cons that each might have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjj8j2nt3eyjav8zcbwob.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjj8j2nt3eyjav8zcbwob.png" alt="Graph showing WWE Monday Night Raw Average TV Ratings per year from 1996-2015."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcw9vj7fm92178qujvvo2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcw9vj7fm92178qujvvo2.png" alt="Long description for the above graph can be found in the paragraphs below."&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These two photos display information regarding the yearly average TV ratings for World Wrestling Entertainment's weekly live episodic show, Monday Night Raw from 1996-2015.  The first image is a bar graph that has the years listed across the x axis (1996-2015) and the average ratings listed on the y axis (1-7).  The second image is the graph's long description that explains the graph's data in more detail.  The first part of this description is an overview paragraph that reads...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The bar graph shows the per year average television ratings for World Wrestling Entertainment's flagship weekly show, Monday Night Raw, between the years 1996 and 2015.  The years between 1998 and 2001 were the ones with the highest average rating.  This period of time is often regarded by wrestling fans as the time when WWE was producing the best product.  The high ratings and premiere product could be contributed to the company having direct competition with World Championship Wrestling (WCW) on Monday nights, the level of talent the company had with stars like The Rock and Stone Cold Steve Austin at the fore front, and the provocative and somewhat controversial segments that were being produced at the height of what is known as "The Attitude Era".  1996, 1997, 2015 were among the years with the lowest average rating.  The remainder of the years were consistently between a 3 and 4 average rating.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second part of this long description includes a table that lists out each year and its average rating as displayed in the graph.  Those data points are as follows...&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Year&lt;/th&gt;
&lt;th&gt;Average Yearly Rating&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1996&lt;/td&gt;
&lt;td&gt;2.64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1997&lt;/td&gt;
&lt;td&gt;2.67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1998&lt;/td&gt;
&lt;td&gt;4.35&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;1999&lt;/td&gt;
&lt;td&gt;6.02&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2000&lt;/td&gt;
&lt;td&gt;5.88&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2001&lt;/td&gt;
&lt;td&gt;4.64&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2002&lt;/td&gt;
&lt;td&gt;4.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2003&lt;/td&gt;
&lt;td&gt;3.77&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2004&lt;/td&gt;
&lt;td&gt;3.67&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2005&lt;/td&gt;
&lt;td&gt;3.81&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2006&lt;/td&gt;
&lt;td&gt;3.90&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2007&lt;/td&gt;
&lt;td&gt;3.61&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2008&lt;/td&gt;
&lt;td&gt;3.27&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2009&lt;/td&gt;
&lt;td&gt;3.57&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2010&lt;/td&gt;
&lt;td&gt;3.28&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2011&lt;/td&gt;
&lt;td&gt;3.21&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2012&lt;/td&gt;
&lt;td&gt;3.00&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2013&lt;/td&gt;
&lt;td&gt;3.01&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2014&lt;/td&gt;
&lt;td&gt;2.95&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2015&lt;/td&gt;
&lt;td&gt;2.65&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Long Description Approach #1
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;figure&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/raw96-15-1.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"WWE Monday Night Raw TV Ratings by Year, 
1996-2015"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;figcaption&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"raw-ratings.html"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
          Monday Night Raw TV Ratings details from graph above
        &lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above approach includes having a link to a separate page where the long description for the graph can be found.  We are wrapping the images and the long description link in a &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; tag, while wrapping the link to the long description in a &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt; tag.  This allows screen readers and assistive technologies to relay to users that the image and the link are related to each other.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros:
&lt;/h4&gt;

&lt;p&gt;1) This approach is supported by all browsers and assistive technologies&lt;/p&gt;

&lt;p&gt;2) This in turn makes the information inside the long description accessible to everyone.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cons:
&lt;/h4&gt;

&lt;p&gt;1) This approach does take the users to a separate page to view the long description information, which in some cases isn't always ideal.&lt;/p&gt;

&lt;h3&gt;
  
  
  Long Description Approach #2
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/raw96-15-1.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"WWE Monday Night Raw TV Ratings by Year, 
1996-2015.  Described under the heading Monday Night Raw TV Ratings Details."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
    [...]
    &lt;span class="nt"&gt;&amp;lt;section&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Monday Night Raw TV Ratings Details&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Overview&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The bar graph shows the per year average television ratings for World 
Wrestling Entertainment's flagship weekly show, Monday Night Raw,  between the 
years 1996 and 2015...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Values&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Numerical values represented on the graph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;Average (Per Year) Ratings for Monday Night Raw 1996-2015&lt;span class="nt"&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Year&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Average Rating&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;1996&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;2.64&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
                [...]       
            &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/section&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Pros:
&lt;/h4&gt;

&lt;p&gt;1) This approach allows for the long description to be on the same page as the image, which keeps users from having to navigate away from the original page to view the detailed description.&lt;/p&gt;

&lt;p&gt;2) The long description is still available to everyone because it included inside the page's text content.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cons:
&lt;/h4&gt;

&lt;p&gt;1) This approach only works if the details for the location of the long description inside the alt text are very specific.  If it isn't specific, then users could become confused as to where the right information is found or they would have to spend time searching for the information on the page.&lt;/p&gt;

&lt;h3&gt;
  
  
  Long Description Approach #3
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;figure&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/raw96-15-1.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"WWE Monday Night Raw TV Ratings by Year, 
1996-2015."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;figcaption&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Monday Night Raw TV Ratings Details&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Overview&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;The bar graph shows the per year average television ratings for World 
Wrestling Entertainment's flagship weekly show, Monday Night Raw, between the years 
1996 and 2015...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h3&amp;gt;&lt;/span&gt;Values&lt;span class="nt"&gt;&amp;lt;/h3&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Numerical values represented on the graph&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;caption&amp;gt;&lt;/span&gt;Average (Per Year) Ratings for Monday Night Raw 1996-2015&lt;span class="nt"&gt;&amp;lt;/caption&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;thead&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Year&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;th&amp;gt;&lt;/span&gt;Average Rating&lt;span class="nt"&gt;&amp;lt;/th&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/thead&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;tbody&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;1996&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                    &lt;span class="nt"&gt;&amp;lt;td&amp;gt;&lt;/span&gt;2.64&lt;span class="nt"&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
                &lt;span class="nt"&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;/tbody&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Pros:
&lt;/h4&gt;

&lt;p&gt;1) This approach also keeps the user from having to navigate away from the current page in order to view the long description.&lt;/p&gt;

&lt;p&gt;2) The long description remains available to everyone as it is also included in the page content in this approach.&lt;/p&gt;

&lt;p&gt;3) Because the long description is inside of the &lt;code&gt;&amp;lt;figcaption&amp;gt;&lt;/code&gt; tag associated with the image's &lt;code&gt;&amp;lt;figure&amp;gt;&lt;/code&gt; tag, which keeps users from having to potentially search the page looking for the content.&lt;/p&gt;

&lt;h4&gt;
  
  
  Cons:
&lt;/h4&gt;

&lt;p&gt;1) Depending on the design needs for your page and the length of the information included in your long description, having it all included in the page content in this way might not be desirable.  It could end up making a page rather long in length and give the user a lot of information to read through and process all at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;An image that represents extremely detailed information and can't be explained or described in one short phrase or sentence is a complex image.  These would be images like graphs, charts, weather maps, illustrations, or an image where the page content relies on the user understanding the image content.  These images need a two part description: one that describes the basic context of the image and another longer description to explain the information and data provided by the image.&lt;/p&gt;

&lt;p&gt;There are a few different approaches to including the long description within your code.  Each one allows the information to be available to everyone who visits the page, however which one is used on your page could depend on design, user experience, and ultimately what makes the most sense for you site.  As long as both descriptions are included and the long description is associated with the image in a way that includes proper semantics and makes it available to everyone, you should be all good to go!&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Image Accessibility 101: Groups of Images</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:28:46 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-groups-of-images-1ngg</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-groups-of-images-1ngg</guid>
      <description>&lt;p&gt;A group of images is a collection of images being used to convey the same or similar pieces of information.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for writing the alt text:
&lt;/h2&gt;

&lt;p&gt;There are two different approaches to writing alt text for a group of images:&lt;/p&gt;

&lt;p&gt;1) For a grouping of images that can be sufficiently described by one sentence: One of the images receives an alt text to describe the entire group, while the others receive an empty alt attribute. &lt;/p&gt;

&lt;p&gt;2) For a grouping that requires a more robust description: The entire group needs a basic description of what the contents of the group are about.  Then each individual image inside of the group needs to have its own description that explains the contents of that image. &lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkzkn3t5lch6fqbir1keo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkzkn3t5lch6fqbir1keo.png" alt="Three filled in stars and two outlined stars used to display a 3 out of 5 star rating."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/star-solid.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Rating: 3 out of 5 stars"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/star-solid.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/star-solid.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/star-regular.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/star-regular.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above image is an example of the first approach explained above.  One alt text is sufficient to describe the entire group. So, the alt text on the first star expresses the overall rating that the group visually displays, while the remaining four images receive an empty alt attribute.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1y666fzcc28a4ig4nhfz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F1y666fzcc28a4ig4nhfz.png" alt="Photos of the guys from the show Impractical Jokers being punished after losing an episode of the show each with captions."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;figure&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt; &lt;span class="na"&gt;aria-labelledby=&lt;/span&gt;&lt;span class="s"&gt;"fig1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;figcaption&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fig1"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Impractical Jokers is a TV show on TruTV that features four 
lifelong friends who compete to embarrass each other in various challenges, whoever 
loses the most challenges every episode gets punished.&lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;figure&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt; &lt;span class="na"&gt;aria-labelledby=&lt;/span&gt;&lt;span class="s"&gt;"fig11"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"figure"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/murr.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Murr jumping out of a plane"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;figcaption&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fig11"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Murr is afraid of heights, so as a punishment, 
the other guys made him go skydiving.&lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;figure&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt; &lt;span class="na"&gt;aria-labelledby=&lt;/span&gt;&lt;span class="s"&gt;"fig12"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"figure"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/q.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"A spider crawls on Q"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;figcaption&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fig12"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;As Q's punishment, they tied him down and put huge 
spiders on him.&lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;figure&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt; &lt;span class="na"&gt;aria-labelledby=&lt;/span&gt;&lt;span class="s"&gt;"fig13"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"figure"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/sel.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Sal climbs down a manhole"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;figcaption&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fig13"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Since Sal is a huge germaphobe, the guys made him go 
into the sewer system to fight "zombies".&lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;figure&lt;/span&gt; &lt;span class="na"&gt;role=&lt;/span&gt;&lt;span class="s"&gt;"group"&lt;/span&gt; &lt;span class="na"&gt;aria-labelledby=&lt;/span&gt;&lt;span class="s"&gt;"fig14"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"figure"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/joe.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Joe dressed as a genie"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;figcaption&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"fig14"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Joe was attached to a harness and sent flying into 
all the stage props throughout the entirety of the play.&lt;span class="nt"&gt;&amp;lt;/figcaption&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/figure&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This image is an example of the second approach described above.  This four image group  &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;An image being used to add a simple concept or piece of information to the content on the page is considered an informative image.  Make your alt text as short and concise as possible and be sure to only include the most relevant information.&lt;/p&gt;

&lt;p&gt;The decision of whether an image is a decorative image or an informative image can be a tricky one and is ultimately up to the person authoring the page.  It comes down to the reason why the image is being included on the page, the content contained on the page, and what makes the most sense overall.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Image Accessibility 101: Images of Text</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:28:29 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-images-of-text-1pad</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-images-of-text-1pad</guid>
      <description>&lt;p&gt;An image of text is an image that has text as the main content that is meant to be readable by the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for writing the alt text:
&lt;/h2&gt;

&lt;p&gt;1) The alt text should be an exact match to the text that appears in the image.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0j5tlejsyr56pw38sju4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0j5tlejsyr56pw38sju4.png" alt="There are no limits to what you can accomplish, except &amp;lt;br&amp;gt;
the limits you place on your own thinking. - Brian Tracy"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/quote1.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"There are no limits to what you can accomplish, except 
the limits you place on your own thinking. - Brian Tracy"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even though this image has a background of a climbing rope and people rock climbing, the main content of the image is the quote.  Therefore, the alt text should be reflective of the quote and its author, rather than the images that appear in the background.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxhtjkewatsbhtac19kbb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxhtjkewatsbhtac19kbb.png" alt="Surprise! 45 is the new age for regular colon screenings."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/card.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Surprise! 45 is the new age for regular colon screenings."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an image from a client site I worked on at work for the American Cancer Society Birmingham Alabama chapter.  They were wanting to make a site to raise awareness for colon cancer.  The site allows you to send a funny card to a loved one encouraging them to get screened.  The alt text for these cards needed to be the exact wording pictured, so that non-visual users could still pick an appropriate invite to send.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can view the full site and entire collection of cards here on the &lt;a href="https://cordiallystopcancer.com/" rel="noopener noreferrer"&gt;Cordially Stop Cancer site&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Important Notes:
&lt;/h3&gt;

&lt;p&gt;1) If the image that you are using is simple text that could be placed in the markup of the page and styled using CSS to match the original image, this is preferred.  Actual text is easier to work with, manipulate, and style than an image.  It also isn't going to become pixelated or distorted when resized.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Images that contain text as the main content that are intended for people to read need to have alt text that contains the exact same text.  This way non-visual users will have the text contents of the image read aloud.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Image Accessibility 101: Functional Images</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:28:15 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-functional-images-e7</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-functional-images-e7</guid>
      <description>&lt;p&gt;A functional image is an image that initiates an action rather than shares information.  These images can enhance buttons, links, and other functional elements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for writing the alt text:
&lt;/h2&gt;

&lt;p&gt;1) It should describe the action that will happen when you click the image, rather than what the image is.&lt;/p&gt;

&lt;p&gt;2) It is crucial for understanding the functionality of the content being displayed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxa6ubp3mkvlqmo1cpckd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxa6ubp3mkvlqmo1cpckd.png" alt="The Netflix logo"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.netflix.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/Netflix-Logo.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Netflix Home"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above image is considered a functional image because the logo is being used as a link to redirect the user back to the site's homepage.  Therefore, you want to include the word &lt;code&gt;Home&lt;/code&gt; in the alt text to indicate to the users that this link brings you back to the home page when clicked.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If the logo was just being used as a stand alone image without also being a link, then the alt text would just read &lt;code&gt;alt="Netflix"&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fs9ts58aa0hgprna6nk7o.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fs9ts58aa0hgprna6nk7o.jpg" alt="A printer icon"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;onclick=&lt;/span&gt;&lt;span class="s"&gt;"window.print();"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/printer-icon-in-flat-style-vector-19244045.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Print this page."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This image would also be considered functional because it is an image inside a button that prints the current page's content when clicked.  The image of the printer indicates to sighted users that the button is for printing.  However, for those who can't visually see the printer, the alt text needs to convey this action to them. &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;An image that is being used to initiate an action or enhance a functional element on the page is a functional image.  It is so important that the alt text reflect the action that will occur, rather than describe what the image is.   &lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Image Accessibility 101: Decorative Images</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:25:51 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-decorative-images-3b30</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-decorative-images-3b30</guid>
      <description>&lt;p&gt;A decorative image is an image that adds visual appeal to the site without adding any additional important information.  This image could strictly be a visual decoration or it could be an image whose contents have already been adequately described in the text content of the page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for writing the alt text:
&lt;/h2&gt;

&lt;p&gt;1) For these images, you want to leave the alt attribute empty (&lt;code&gt;alt=""&lt;/code&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Flyba5sanc8r7pm7gggps.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Flyba5sanc8r7pm7gggps.png" alt="A white card with the American Cancer Society logo on it sticking out of an envelope next to a paragraph about colon cancer awareness."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"envelope__image"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"../assets/images/envelope-back.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"envelope__img-back"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"../assets/images/envelope-card.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"envelope__img-card"&lt;/span&gt; 
&lt;span class="na"&gt;data-aos=&lt;/span&gt;&lt;span class="s"&gt;"raise"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"../assets/images/envelope-cover.png"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;""&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"envelope__img-front"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above image is considered a decorative image because it is not adding any important information to the text alongside it or the rest of the page.  It is only there to be a visual decoration for the page.  Therefore, the image alt texts are left empty.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This image example consists of more than one image because parts of the image were animated, so they needed to be selected separately.  This could also be considered a group of images, which is another type of image that will appear later in this series.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjgjawwv0xeucoeg5ieke.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fjgjawwv0xeucoeg5ieke.png" alt="A variety of decorative cards used as a background image next to a link to share the site on Facebook."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.share-img&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-image&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sx"&gt;url('../images/share.jpg')&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;background-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;cover&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;block&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;27.3rem&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;100%&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This image is also a decorative image that is being used just to enhance the appearance of the page, however, you'll notice that the code for this image is different than the first scenario.  Since the image takes up the full height and width of its container and is not adding any information to the page, it can easily be added to the page through the CSS background image property.  This keeps it out of the markup completely and allows it to get passed over by a screen reader.&lt;/p&gt;

&lt;h3&gt;
  
  
  Important Notes:
&lt;/h3&gt;

&lt;p&gt;1) Although the alt attribute is being left empty, it still needs to be present inside the &lt;code&gt;&amp;lt;img /&amp;gt;&lt;/code&gt; tag.  If left out completely, the screen reader will usually read out the name of the image file.  This can be quite confusing for users.&lt;/p&gt;

&lt;p&gt;2) Adding alt text to these types of images can create audible clutter or be distracting for screen reader users.  This is especially true if the information being shared isn't important to or doesn't match the contents of the page.&lt;/p&gt;

&lt;p&gt;3) You can also use the WAI-ARIA &lt;code&gt;role="presentation"&lt;/code&gt; attribute to hide images from screen readers, however, not all screen readers acknowledge this.  So, if you are going to use it, be sure to pair it with the empty alt attribute.&lt;/p&gt;

&lt;p&gt;4) Utilize pseudo-elements and background image properties in CSS to represent decorative images, whenever possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Any image being used on a site solely to enhance the appearance of the site or has already been thoroughly described within the text content, would be considered a decorative image.  &lt;/p&gt;

&lt;p&gt;If and when possible, try to present these images through a CSS property. &lt;br&gt;
 If this doesn't work for an image, the alt attribute for the image needs to be present, but left blank. &lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Image Accessibility 101: Informative Images</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:25:20 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-informative-images-5759</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-informative-images-5759</guid>
      <description>&lt;p&gt;An informative image is an image that conveys a simple concept or piece of information that is represented on the page.  These images can be used to supplement or label other information, portray an emotion or impression, or convey concise information or instructions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for writing the alt text:
&lt;/h2&gt;

&lt;p&gt;1) They should be brief and concise, no longer than a phrase or short sentence.&lt;/p&gt;

&lt;p&gt;2) Only the most crucial information should be included.&lt;/p&gt;

&lt;p&gt;3) They often times aren't a literal description of the image, however, in some instances this could be necessary.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples:
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fme9xl84dkodlcv6r6mf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fme9xl84dkodlcv6r6mf4.png" alt="Telephone and fax machine icons with ten digit numbers displayed next to them."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/phone-alt-solid.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Telephone: "&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt; 615-555-9023
&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/fax-solid.svg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Fax: "&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt; 615-555-1234
&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above image is considered an informative image because the images of the phone and the fax machine are being used to label the numbers that appear next to them and clarify which is which in the event that you needed to contact that individual or company.  The alt texts are going to audibly label the numbers for any user that can't see the visual labels.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu9l3noe6lilcm2y4eo12.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu9l3noe6lilcm2y4eo12.jpg" alt="A family smiling and hugging outside."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/Familyfun.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"We are a family friendly company."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This image is one that could be found on a company's website to portray an environment that caters to families and strives to provide a fun, safe experience for its customers.  Since this is a stock photo, the people shouldn't be identified and the alt text instead conveys the image's intended impression.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkguahi9g6v1e7emcorjg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkguahi9g6v1e7emcorjg.jpg" alt="A medicine bottle cap with two step instructions for how to open it."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/top.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Push down on cap, then turn it counter-clockwise."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This image would be considered an informative image because it is visually displaying the specific instructions for opening the medicine bottle pictured.  The alt text is then used to explain these instructions for those who are unable to use the visual cues seen on the cap. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff9t3dfbctj0q8x9rqxkx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Ff9t3dfbctj0q8x9rqxkx.png" alt="Maddie Mastro, Chloe Kim, and Xuetong Cai on the podium at the Burton US Open for women's snowboard superpipe."&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"img/MastroHERO.jpg"&lt;/span&gt; &lt;span class="na"&gt;alt=&lt;/span&gt;&lt;span class="s"&gt;"Maddie Mastro edges out Chloe Kim and Xuetong Cai 
for superpipe gold."&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Professional snowboarder, Maddie Mastro, lands historic run at the 2019 Burton US Open 
becoming the first woman to successfully land a double crippler in competition.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This last image is also an informative image because the image is adding information to the text that accompanies it.  In the text, you learn that Maddie made history at the Burton US Open this past winter.  The picture, however, further indicates to readers that she finished in first ahead of Chloe Kim and Xuetong Cai.  Therefore, the alt text conveys this extra bit of information.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now, if the text had included the fact that Mastro had claimed a gold medal ahead of Kim and Cai, then this image would most likely become a decorative image. Since the imformation in the picture would already be conveyed elsewhere on the page, the image having an alt text would become repetitive.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;An image being used to add a simple concept or piece of information to the content on the page is considered an informative image.  Make your alt text as short and concise as possible and be sure to only include the most relevant information.&lt;/p&gt;

&lt;p&gt;The decision of whether an image is a decorative image or an informative image can be a tricky one and is ultimately up to the person authoring the page.  It comes down to the reason why the image is being included on the page, the content contained on the page, and what makes the most sense overall.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>Image Accessibility 101: What is it and why is it important?</title>
      <dc:creator>Amanda Hasenzahl</dc:creator>
      <pubDate>Fri, 20 Sep 2019 16:25:01 +0000</pubDate>
      <link>https://dev.to/alhasenzahl/image-accessibility-101-what-is-it-and-why-is-it-important-7c3</link>
      <guid>https://dev.to/alhasenzahl/image-accessibility-101-what-is-it-and-why-is-it-important-7c3</guid>
      <description>&lt;p&gt;Web accessibility is a very important, but often times over looked topic in the world of web development.  When done properly, it allows as many people as possible to use the web and it makes the user experience more efficient and pleasant for everyone, not just those with a disability. &lt;/p&gt;

&lt;p&gt;Image accessibility is a small piece of this, but it can contribute greatly to the overall accessibility of your site and how users understand and interact with the content.  Making your site's images as accessible as possible goes way beyond just making sure that the image has alt text.  The text that gets put, or not put, inside of the alt attribute varies greatly based on the purpose of the image and the content that surrounds it.&lt;/p&gt;

&lt;p&gt;The following series is a look into the seven purposes an image can serve on a site and how to approach writing the most effective alt texts in each case in order to help make your site as accessible as possible.&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>html</category>
    </item>
  </channel>
</rss>
