> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Html

<AccordionGroup>
  <Accordion title="<li> and <dt> item tags should be in <ul>, <ol> or <dl> container tags">
    <div class="paragraph">
      <p>Using a <code>\<li> or \<dt> item tag outside of a \<ul>, \<ol> or \<dl></code> one does not make sense and indicates a bug.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <li>Apple</li>          <!-- Noncompliant -->
      <li>Strawberry</li>     <!-- Noncompliant -->

      <li>Apple</li>          <!-- Noncompliant -->
      <li>Strawberry</li>     <!-- Noncompliant -->

      <dt>Apple</dt>          <!-- Noncompliant -->
      <dt>Strawberry</dt>     <!-- Noncompliant -->
      ```

      ```html Fix theme={null}
      <ul>
      <li>Apple</li>
      <li>Strawberry</li>
      </ul>

      <ol>
      <li>Apple</li>
      <li>Strawberry</li>
      </ol>

      <dl>
      <dt>Apple</dt>
      <dt>Strawberry</dt>
      </dl>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Table cells should reference their headers">
    <div class="paragraph">
      <p>If a \`\<td> cell has a headers attribute, it should reference only IDs of headers in the same column and row.</p>
    </div>

    <div class="paragraph">
      <p>Note that it is usually better to use scope attributes of \<th> headers instead of headers attribute. headers attribute requires you to list every corresponding \<th> header’s id, which is error-prone and makes the code less maintainable. See <a href="https://www.w3.org/WAI/tutorials/tables/tips/">W3C WAI Web Accessibility Tutorials</a> for more information.</p>
    </div>

    <div class="paragraph">
      <p>If your table is too complex, it might be better to split it into multiple small tables as it improves both readability and maintainability.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when the headers attribute of a \<td>\` cell contains IDs which don’t belong to a header in the same row or column.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <table border="1">
      <caption>
      Rental price
      </caption>
      <thead>
      <tr>
          <td></td>
          <th id="small" scope="col">
              Small car
          </th>
          <th id="big" scope="col">
              Big Car
          </th>
      </tr>
      </thead>
      <tbody>
      <tr>
          <th id="paris" class="span" colspan="3" scope="colgroup">
              Paris
          </th>
          </tr>
          <tr>
          <th headers="paris" id="day1">
              1 day
          </th>
          <td headers="paris day1 big"> <!-- Noncompliant, referencing the column "big" instead of "small" -->
              11 euros
          </td>
          <td headers="berlin day1 big"> <!-- Noncompliant, there is no header with id "berlin" -->
              50 euros
          </td>
          </tr>
      </tr>
      </tbody>
      </table>
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<!DOCTYPE> declarations should appear before <html> tags">
    <div class="paragraph">
      <p>The \`\<!DOCTYPE> declaration tells the web browser which (X)HTML version is being used on the page, and therefore how to interpret the various elements.</p>
    </div>

    <div class="paragraph">
      <p>Validators also rely on it to know which rules to enforce.</p>
    </div>

    <div class="paragraph">
      <p>It should always preceed the \<html>\` tag.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <html>  <!-- Noncompliant -->
      ...
      </html>
      ```

      ```html Fix theme={null}
      <!DOCTYPE html>
      <html>  <!-- Compliant -->
      ...
      </html>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Tables used for layout should not include semantic markup">
    <div class="paragraph">
      <p>Tables used for layout should not include semantic markup, such as \`\<th> elements, as it can confuse assistive technologies. At best this information is ignored by screen readers and makes the code less maintainable. However it can also confuse some screen readers and reduce the web page accessibility.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when a \<table> element containing the role attribute set to "presentation" or "none" also contains any of:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>a \<caption> element</p>
        </li>

        <li>
          <p>a \<th> element</p>
        </li>

        <li>
          <p>a non-empty summary attribute</p>
        </li>

        <li>
          <p>an \<td> element with a headers or scope\` attribute</p>
        </li>
      </ul>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <table role="presentation" summary="bla"> <!-- Noncompliant -->
      <caption>People</caption> <!-- Noncompliant -->
      <tr>
      <td></td>
      <th>Name</th> <!-- Noncompliant -->
      <th id="myid1">Age</th> <!-- Noncompliant -->
      </tr>
      <tr>
      <td scope="row">1</td> <!-- Noncompliant -->
      <td>John Doe</td>
      <td>24</td>
      </tr>
      <tr>
      <td id="myid2">2</td>
      <td headers="myid1 myid2">Alice Doe</td> <!-- Noncompliant -->
      <td>54</td>
      </tr>
      </table>
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<title> should be present in all pages">
    <div class="paragraph">
      <p>Titles are important because they are displayed in search engine results as well as the browser’s toolbar.</p>
    </div>

    <div class="paragraph">
      <p>This rule verifies that the <code>\<head> tag contains a \<title> one, and the \<html> tag a \<head></code> one.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <html>         <!-- Non-Compliant -->

      <body>
      ...
      </body>

      </html>
      ```

      ```html Fix theme={null}
      <html>         <!-- Compliant -->

      <head>
      <title>Some relevant title</title>
      </head>

      <body>
      ...
      </body>

      </html>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<th> tags should have id or scope attributes">
    <div class="paragraph">
      <p>Associating \`\<table> headers, i.e. \<th> elements, with their \<td> cells enables screen readers to announce the header prior to the data. This considerably increases the accessibility of tables to visually impaired users.</p>
    </div>

    <div class="paragraph">
      <p>There are two ways of doing it:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Adding a scope attribute to \<th> headers.</p>
        </li>

        <li>
          <p>Adding an id attribute to \<th> headers and a headers attribute to every \<td> element.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>It is recommended to add scope attributes to \<th> headers whenever possible. Use \<th id="..."> and \<td headers="..."> only when \<th scope="..."> is not capable of associating cells to their headers. This happens for very complex tables which have headers splitting the data in multiple subtables. See <a href="https://www.w3.org/WAI/tutorials/tables/tips/">W3C WAI Web Accessibility Tutorials</a> for more information.</p>
    </div>

    <div class="paragraph">
      <p>Note that complex tables can often be split into multiple smaller tables, which improves the user experience.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when a \<th> element has neither id nor scope\` attributes set.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <table border="1">
      <caption>Contact Information</caption>
      <tr>
      <td></td>
      <th>Name</th>                                          <!-- Non-Compliant -->
      <th>Phone#</th>                                        <!-- Non-Compliant -->
      <th>City</th>                                          <!-- Non-Compliant -->
      </tr>
      <tr>
      <td>1.</td>
      <th>Joel Garner</th>                                   <!-- Non-Compliant -->
      <td>412-212-5421</td>
      <td>Pittsburgh</td>
      </tr>
      <tr>
      <td>2.</td>
      <th>Clive Lloyd</th>                                   <!-- Non-Compliant -->
      <td>410-306-1420</td>
      <td>Baltimore</td>
      </tr>
      </table>
      ```

      ```html Fix theme={null}
      <table border="1">
      <caption>Contact Information</caption>
      <tr>
      <td></td>
      <th scope="col">Name</th>                              <!-- Compliant -->
      <th scope="col">Phone#</th>                            <!-- Compliant -->
      <th scope="col">City</th>                              <!-- Compliant -->
      </tr>
      <tr>
      <td>1.</td>
      <th scope="row">Joel Garner</th>                       <!-- Compliant -->
      <td>412-212-5421</td>
      <td>Pittsburgh</td>
      </tr>
      <tr>
      <td>2.</td>
      <th scope="row">Clive Lloyd</th>                       <!-- Compliant -->
      <td>410-306-1420</td>
      <td>Baltimore</td>
      </tr>
      </table>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<strong> and <em> tags should be used">
    <div class="paragraph">
      <p>The \`\<strong>/\<b> and \<em>/\<i> tags have exactly the same effect in most web browsers, but there is a fundamental difference between them: \<strong> and \<em> have a semantic meaning whereas \<b> and \<i> only convey styling information like CSS.</p>
    </div>

    <div class="paragraph">
      <p>While \<b> can have simply no effect on a some devices with limited display or when a screen reader software is used by a blind person, \<strong> will:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Display the text bold in normal browsers</p>
        </li>

        <li>
          <p>Speak with lower tone when using a screen reader such as Jaws</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Consequently:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>in order to convey semantics, the \<b> and \<i> tags shall never be used,</p>
        </li>

        <li>
          <p>in order to convey styling information, the \<b> and \<i>\` should be avoided and CSS should be used instead.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <i>car</i>             <!-- Noncompliant -->
      <b>train</b>         <!-- Noncompliant -->
      ```

      ```html Fix theme={null}
      <em>car</em>
      <strong>train</strong>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Scriptlets should not be used">
    <div class="paragraph">
      <p>Just because you <em>can</em> do something, that doesn’t mean you <em>should</em>, and the use of full-fledged Java in a JSP or JSF falls into that category.</p>
    </div>

    <div class="paragraph">
      <p>Beside the fact that such code isn’t resuable, testable, maintainable or OO-inheritable, using Java in such client-side pages can leave you incredibly vulnerable from a number of perspectives including security and resource management.</p>
    </div>

    <div class="paragraph">
      <p>Instead, any heavy-duty logic should happen server-side in a full-fledged Java class. For lighter-weight functions, taglibs should be used.</p>
    </div>

    <div class="paragraph">
      <p>This rule flags all uses of JSP declarations (<code>\<%! ... %> and \<jsp:declaration>...\</jsp:declaration>) and scriptlets (\<% ... %></code>).</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <%!  // Noncompliant
      private Connection conn = null;

      public void init() {
      try {
        Class.forName("org.hsqldb.jdbcDriver" );
        conn = DriverManager.getConnection("jdbc:hsqldb:mem:SQL", "sa", "");
      } catch (SQLException e) {
        getServletContext().log("Db error: " + e);
      } catch (Exception e) {
      getServletContext().log("System error: " + e);
      }
      }
      %>
      <%    // Noncompliant
      Statement stmt = conn.createStatement();
      ResultSet rs = null;
      String query = StringEscapeUtils.escapeHtml4(query).replaceAll("'", "&#39");

      try {
      String sql = "SELECT PRODUCT, DESC, TYPE, PRICE " +
                       "FROM PRODUCTS" +
                       "WHERE PRODUCT LIKE '%" + query + "%'";
      rs = stmt.executeQuery(sql);

      String output = "";
      int count = 0;
      while (rs.next()) {
      count++;
      output = output.concat("<TR><TD>" + rs.getString("PRODUCT") + 
                                    "</TD><TD>" + rs.getString("DESC") + 
                                    "</TD><TD>" + rs.getString("TYPE") + 
                                    "</TD><TD>" + rs.getString("PRICE") + "</TD></TR>\n");
      }
      if(count > 0){
      %>
      <TABLE border="1">
      <TR><TD>Product</TD><TD>Description</TD><TD>Type</TD><TD>Price</TD></TR>
      <%= output %>
      </TABLE>
      <%  // Noncompliant
      }
      } catch (Exception e) {
      // ...
      ```

      ```html Fix theme={null}
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

      <table>
      <c:forEach items="${products}" var="product">
          <tr>
              <td>${product.name}</td>
              <td>${product.description}</td>
              <td>${product.type}</td>
              <td>${product.price}</td>
          </tr>
      </c:forEach>
      </table>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<script>...</script> elements should not be nested">
    <div class="paragraph">
      <p>When parsing a script node, the browser treats its contents as plain text, and immediately finishes parsing when it finds the first closing \`\</script> character sequence.</p>
    </div>

    <div class="paragraph">
      <p>As a consequence, nested script nodes are not possible, because all opening \<script> tags found along the way are ignored.</p>
    </div>

    <div class="paragraph">
      <p>Web browsers doesn’t support nested \<script>...\</script> elements. But there is no error in such case and browsers just close the first encountered \<script> tag as soon as a closing \</script>\` tag is found along the way. So there is a big chance to display something totally unexpected to the end-users.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <script type="text/template">
      <div>
      Hello!
      </div>
      <script type="text/javascript">  <!-- Noncompliant -->
      alert("Hi!");
      </script>
      </script>
      ```

      ```html Fix theme={null}
      <script type="text/javascript">
      alert("Hi!");
      </script>

      <script type="text/template">
      <div>
      Hello!
      </div>
      </script>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track lack of required an element with the required id">
    <div class="paragraph">
      <p>This rule allows you to make sure that each HTML page contains an element with your configured ID, regardless of element type. This rule is useful, for instance, if your design requires a placeholder to be present in each page, for example to dynamically insert a footer.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <div id="#footer">
      ...
      </div>
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Web pages should not contain absolute URIs">
    <div class="paragraph">
      <p>It is considered best-practice to use relative URLs in web pages to prevent having to update the addresses if the web address in use changes. Moreover, if some absolute URLs are missed in such a process, it will obviously impact the user experience.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <img src="http://www.myserver.com/smiley.gif" alt="Smiley face" height="42" width="42" />
      ```

      ```html Fix theme={null}
      <img src="smiley.gif" alt="Smiley face" height="42" width="42" />
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<table> tags should have a description">
    <div class="paragraph">
      <p>In order to be accessible to visually impaired users, it is important that tables provides a description of its content before the data is accessed.</p>
    </div>

    <div class="paragraph">
      <p>The simplest way to do it, and also the one <a href="https://www.w3.org/TR/WCAG20-TECHS/H39">recommended by WCAG2</a> is to add a \`\<caption> element inside the \<table>.</p>
    </div>

    <div class="paragraph">
      <p>Other technics this rule accepts are:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>adding a concise description via <a href="https://www.w3.org/TR/wai-aria/#aria-label">aria-label</a> or <a href="https://www.w3.org/TR/wai-aria/#aria-labelledby">aria-labelledby</a> attributes in the \<table>.</p>
        </li>

        <li>
          <p>referencing a description element with an <a href="https://www.w3.org/TR/wai-aria/#aria-describedby">aria-describedby</a> attribute in the \<table>.</p>
        </li>

        <li>
          <p>embedding the \<table> inside a \<figure> which also contains a \<figcaption>.</p>
        </li>

        <li>
          <p>adding a summary attribute to the \<table> tag. However note that this attribute has been deprecated in HTML5.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>See <a href="https://www.w3.org/WAI/tutorials/tables/tips/">W3C WAI Web Accessibility Tutorials</a> for more information.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when a \<table>\` has neither of the previously mentioned description mechanisms.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <table> <!-- Noncompliant -->
      ...
      <table>
      ```

      ```html Fix theme={null}
      <table>
      <caption>New York City Marathon Results 2013</caption>
      ...
      </table>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="JavaScript scriptlets should not have too many lines of code">
    <div class="paragraph">
      <p>Long pieces of JavaScript should be located in dedicated \*.js source files. This makes maintenance of both the script and the pages that use it easier. Additionally, it offers some efficiencies in serving the files, since it takes better advantage of browser caching to only re-serve the parts of a web page that have actually changed.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <head>
      ...
      <script type="text/javascript" language="JavaScript">  <!-- Noncompliant -->
      function doTheThing(arg1) {
        ...
        ...
      }

      function doTheOtherThing(arg1) {
        ...
      } 

      function andSoOn() {
        ...
      }
      </script>
      </head>
      ```

      ```html Fix theme={null}
      <head>
      ...
      <script type="text/javascript" language="JavaScript" src="myLongScript.js"> </script>
      </head>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track lack of required attributes">
    <div class="paragraph">
      <p>This rule checks that the specified attributes are present in HTML tags.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <img src="/images/queen.png"> <!-- Noncompliant; missing all required attributes -->
      ```

      ```html Fix theme={null}
      <img src="/images/queen.png" width="60" height="85" alt="Elizabeth II">
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Flash animations should be embedded using the window mode">
    <div class="paragraph">
      <p>Browsers best support the \`window mode for the wmode parameter, also in terms of accessibility.</p>
    </div>

    <div class="paragraph">
      <p>As it is the default mode, it is acceptable to either not specify a wmode parameter altogether, or to set it explicitly to window\`.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400">
      <param name="movie" value="movie_name.swf" />
      <param name="wmode" value="direct" />                              <!-- Non-Compliant -->
      </object>

      <embed src="movie_name.swf"
         width="550"
         height="400"
         wmode="direct"                                                                 <!-- Non-Compliant -->
         type="application/x-shockwave-flash"
         pluginspage="http://www.macromedia.com/go/getflashplayer" />
      ```

      ```html Fix theme={null}
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400">
      <param name="movie" value="movie_name.swf" />
      </object>

      <embed src="movie_name.swf"
         width="550"
         height="400"
         type="application/x-shockwave-flash"
         pluginspage="http://www.macromedia.com/go/getflashplayer" />
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<html> element should have a language attribute">
    <div class="paragraph">
      <p>The \`\<html> element should provide the lang and/or xml:lang attribute in order to identify the default language of a document.</p>
    </div>

    <div class="paragraph">
      <p>It enables assistive technologies, such as screen readers, to provide a comfortable reading experience by adapting the pronunciation and accent to the language. It also helps braille translation software, telling it to switch the control codes for accented characters for instance.</p>
    </div>

    <div class="paragraph">
      <p>Other benefits of marking the language include:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>assisting user agents in providing dictionary definitions or helping users benefit from translation tools.</p>
        </li>

        <li>
          <p>improving <a href="https://blogs.bing.com/webmaster/March-2011/How-To-Tell-Bing-Your-Website-s-Country-and-Langua">search engine ranking</a>.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Both the lang and the xml:lang\` attributes can take only one value.</p>
    </div>

    <div class="paragraph">
      <p> </p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <!DOCTYPE html>
      <html> <!-- Noncompliant -->
          <head>
               <title>A page written in english</title>
               <meta content="text/html; charset=utf-8" />
          </head>  


          <body>     
          ...   
          </body>
      </html>
      ```

      ```html Fix theme={null}
      <!DOCTYPE html>
      <html lang="en">
          <head>
               <title>A page written in english</title>
               <meta content="text/html; charset=utf-8" />
          </head>  


          <body>     
          ...   
          </body>
      </html>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track uses of disallowed elements">
    <div class="paragraph">
      <p>This rule checks that the specified HTML elements are not present.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <center><font color="red">Hello World!</font></center> <!-- Noncompliant -->
      ```

      ```html Fix theme={null}
      <div class="centerRed">Hello World!</div>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Heading tags should be used consecutively from H1 to H6">
    <div class="paragraph">
      <p>Heading tags are used by search engines and screen reader softwares to construct an outline of the page.</p>
    </div>

    <div class="paragraph">
      <p>Starting at <code>\<h1></code> and not skipping any level eases this automatic construction.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <h2>My Title</h2>     <!-- Non-Compliant - h1 is not being used -->

      <h3>My Sub Title</h3> <!-- Compliant -->
      ```

      ```html Fix theme={null}
      <h1>My Title</h1>     <!-- Compliant -->

      <h2>My Sub Title</h2> <!-- Compliant -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="autocomplete should be set to off on input elements of type password">
    <div class="paragraph">
      <p>Most browsers automatically fill the content of input elements of type 'password' when this password has already been provided in the past.</p>
    </div>

    <div class="paragraph">
      <p>Imagine that user B takes control of a machine belonging to a user A. Accessing a secured web site as user A is trivial for user B if form input elements are automatically filled in by the browser on the site’s login page.</p>
    </div>

    <div class="paragraph">
      <p>HTML 5 specifies the ability to turn this functionality off on a field-by-field basis using the <code>autocomplete</code> attribute, but most modern browsers ignore it in favor of their own password management.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <input type="password" />
      ```

      ```html Fix theme={null}
      <input type="password" autocomplete="off" />
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="iframes should be sandboxed">
    <div class="paragraph">
      <p>HTML5 introduces the ability to restrict the permissions of content loaded into an \`iframe. Simply adding the sandbox attribute to an iframe tag limits the iframe to simply loading the specified contents; no scripts will run, no popups will pop, and so on. You can re-enable additional functions individually by specifying them in the attribute’s value:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>allow-forms - form submission</p>
        </li>

        <li>
          <p>allow-popups - popups</p>
        </li>

        <li>
          <p>allow-scripts - script execution</p>
        </li>

        <li>
          <p>allow-pointer-lock - access to the "pointer lock" API</p>
        </li>

        <li>
          <p>allow-same-origin - sandboxed content is marked as being from a different domain (even when it’s not). This attribute turns that off so that, for instance, the iframe content can access its site’s cookies.</p>
        </li>

        <li>
          <p>allow-top-navigation - turns the target attribute of a tags back on</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Following the principle of minimum privileges, this rule raises an issue for each iframe which does not have a sandbox\` attribute.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <iframe src="https://platform.twitter.com/widgets/tweet_button.html"
          style="border: 0; width:130px; height:20px;">  <!-- Noncompliant -->
      </iframe>
      ```

      ```html Fix theme={null}
      <iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
      src="https://platform.twitter.com/widgets/tweet_button.html"
      style="border: 0; width:130px; height:20px;">
      </iframe>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track lack of required child elements">
    <div class="paragraph">
      <p>This rule checks that the specified child elements are present inside the specified parent elements.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <html>
      <head>
      </head>  <!-- Noncompliant; no title element -->
      <body>
      ...
      ```

      ```html Fix theme={null}
      <html>
      <head>
      <title>My Page</title>
      </head>
      <body>
      ...
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Links should not target # or javascript:void(0)">
    <div class="paragraph">
      <p>There are two ways to build a link that has the sole purpose of running JavaScript code. The goal of this rule is to ban such patterns in order to support browsing with JavaScript disabled.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <a href="#" onclick="alert('Clicked!'); return false;">Run JavaScript Code</a> <!-- Noncompliant -->
      <a href="javascript:void(0)" onclick="alert('Clicked!'); return false;">Run JavaScript Code</a>  <!-- Noncompliant -->
      <a id="inPageAnchor">Jump down the page to me</a>  <!-- Compliant -->
      ```

      ```html Fix theme={null}
      <a id="inPageAnchor">Jump down the page to me</a>  <!-- Compliant -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Assignments should not be made in boolean contexts">
    <div class="paragraph">
      <p>The assignment of a boolean variable inside the test of a control structure such as an <code>if, while or for</code> loop is almost always a mistake and should be corrected to avoid unexpected program results. In fact, even if it was done on purpose, it should be re-examined.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      boolean b = false;
      if ( b = m.getTrue()) { ... } // Noncompliant

      while (b = getTrue()) { ... } // Noncompliant; unintentionally infinite

      for (int i = 0; i < 10 && b = getTrue(); i++) { ... } // Noncompliant
      ```

      ```html Fix theme={null}
      boolean b = false;
      if ( b = m.getTrue())
      {
      System.out.println("How did we get here");
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Image tags should have width and height attributes">
    <div class="paragraph">
      <p>If the <code>width and height</code> attributes are set, the space required for the image is reserved immediately by the browser, even before it actually starts to load the image.</p>
    </div>

    <div class="paragraph">
      <p>Without those attributes, the page layout constantly changes as images are loaded until they are all loaded, which can disorient users.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <img src="logo.png" alt="My Company" />                           <!-- Non-Compliant -->
      ```

      ```html Fix theme={null}
      <img src="logo.png" alt="My Company" width="100" height="50" />   <!-- Compliant -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Flash animations should be embedded using both <object> and <embed>">
    <div class="paragraph">
      <p>The \`\<object> tag is used by Internet Explorer 3.0 or later on Windows platforms or any browser that supports the use of the Flash ActiveX control. The \<embed> tag is used by Netscape Navigator 2.0 or later, or browsers that support the use of the Netscape-compatible plug-in version of Flash Player.</p>
    </div>

    <div class="paragraph">
      <p>When an ActiveX-enabled browser loads the HTML page, it reads the values set on the \<object> and ignores the \<embed> tag. When browsers using the Flash plug-in load the HTML page, they read the values set on the \<embed> tag and ignore the \<object>\` tag.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="100">      <!-- Non-Compliant -->
      <param name="movie" value="movie_name.swf" />
      </object>

      <embed src="movie_name.swf"                                                                 <!-- Non-Compliant -->
         width="550"
         height="400"
         type="application/x-shockwave-flash"
         pluginspage="http://www.macromedia.com/go/getflashplayer" />
      ```

      ```html Fix theme={null}
      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100" height="100">      <!-- Compliant -->
      <param name="movie" value="movie_name.swf" />
      <embed src="movie_name.swf"                                                               <!-- Compliant -->
         width="550"
         height="400"
         type="application/x-shockwave-flash"
         pluginspage="http://www.macromedia.com/go/getflashplayer" />
      </object>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Disallowed taglibs should not be used">
    <div class="paragraph">
      <p>This rule checks that the disallowed tag libraries are not used.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="prefixOfTag" > <!-- Noncompliant -->
      <jsp:directive.taglib uri="http://java.sun.com/jstl/sql" prefix="prefixOfTag" /> <!-- Noncompliant -->
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track uses of disallowed child elements">
    <div class="paragraph">
      <p>This rule checks that the specified child tag does not appear as a direct child of the specified parent.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <head>
      ...
      <body>  <!-- Noncompliant -->
      ...
      </body>
      </head>
      ```

      ```html Fix theme={null}
      <head>
      ...
      </head>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Attributes should be quoted using double quotes rather than single ones">
    <div class="paragraph">
      <p>Checker to find use of single quote where double quote is preferred.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <div id='header'></div>
      ```

      ```html Fix theme={null}
      <div id="header"></div>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Attributes should be quoted using single quotes">
    <div class="paragraph">
      <p>Checker to find use of double quote where single quote is preferred.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      &lt;div id="header"&gt;&lt;/div&gt;
      ```

      ```html Fix theme={null}
      &lt;div id='header'&gt;&lt;/div&gt;
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="JSF expressions should be syntactically valid">
    <div class="paragraph">
      <p>This rule allows to make sure that all JSF Expressions are syntactically correct.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
      <h:body>
       First name 
       <h:outputText value="#{user.firstName && @@}"/>   <!-- Noncompliant -->
      </h:body>
      </html>
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Meta tags should not be used to refresh or redirect">
    <div class="paragraph">
      <p>Use of <code>\<meta http-equiv="refresh"></code> is discouraged by the World Wide Web Consortium (W3C).</p>
    </div>

    <div class="paragraph">
      <p>If a user clicks the 'Back' button, some browers will go back to the redirecting page, which will prevent the user from actually going back.</p>
    </div>

    <div class="paragraph">
      <p>To refresh the page, a better alternative is to use Ajax, to refresh only what needs to be refreshed and not the whole page.</p>
    </div>

    <div class="paragraph">
      <p>To redirect to another page, using the HTTP response status code 301 'Moved Permanently' and 302 'Found' is a better option.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <head>
      <meta http-equiv="refresh" content="5">   <!-- Non-Compliant -->
      <meta name="description" content="..."> 
      </head>
      ```

      ```html Fix theme={null}
      <head>
      <meta name="description" content="..."> 
      </head>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Image, area and button with image elements should have an alt attribute">
    <div class="paragraph">
      <p>The \`alt attribute provides a textual alternative to an image.</p>
    </div>

    <div class="paragraph">
      <p>It is used whenever the actual image cannot be rendered.</p>
    </div>

    <div class="paragraph">
      <p>Common reasons for that include:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>The image can no longer be found</p>
        </li>

        <li>
          <p>Visually impaired users using a screen reader software</p>
        </li>

        <li>
          <p>Image loading is disabled, to reduce data consumption on mobile phones</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>It is also very important not to set an alt attribute to a non-informative value. For example, \<img ... alt="logo"> is useless as it doesn’t give any information to the user. In this case, as for any other decorative image, it is better to use a CSS background image instead of an \<img> tag. If using CSS background-image is not possible, an empty alt="" is tolerated. See Exceptions below.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>An \<input type="image"> or \<area> element has no alt attribute or it holds an empty string value.</p>
        </li>

        <li>
          <p>An \<img> element has no alt\` attribute.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <li *ngFor="let image of images">
      <img [src]="image" alt="">
      </li>
      ```

      ```html Fix theme={null}
      <a href="flowers.html">
      <img src="tulip.gif" alt="" />
      A blooming tulip
      </a>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="JSP expressions should not be used">
    <div class="paragraph">
      <p>JSP expressions (using <code>\<%= ... %></code>) have been deprecated because they:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Are not unit testable.</p>
        </li>

        <li>
          <p>Are not reusable.</p>
        </li>

        <li>
          <p>Cannot make use of object oriented concepts such as inheritence.</p>
        </li>

        <li>
          <p>Have poor error handling capabilities: if an exception is thrown, an empty page is rended.</p>
        </li>

        <li>
          <p>Mix the business and presentation logic.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>JSP Standard Tag Library (JSTL) and Expression Language should be used instead, enabiling the adoption of the model-view-controller (MVC) design pattern which reduces the coupling between the presentation tier and the business logic.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <input type="text" name="foo" value="<%= request.getParameter("foo") %>" />
      ```

      ```html Fix theme={null}
      <input type="text" name="foo" value="${fn:escapeXml(param.foo)}" />
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Some Java packages or classes should not be used in JSP files">
    <div class="paragraph">
      <p>This rule raises an issue when a configured Java package or class is used in a JSP file.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <%@ page import="java.sql.*" %>     <!-- Noncompliant -->
      <% java.util.ArrayList clients; %>  <!-- Noncompliant -->
      <% java.lang.String name; %>        <!-- Compliant -->
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track uses of disallowed attributes">
    <div class="paragraph">
      <p>This rule checks that the specified attributes are not present in HTML tags.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <a href="blah.com" name="Blah link"> <!-- Noncompliant; name attribute is used -->
      ```

      ```html Fix theme={null}
      <a href="blah.com">
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="All HTML tags should be closed ">
    <div class="paragraph">
      <p>Even if all browsers are fault-tolerant, HTML tags should be closed to prevent any unexpected behavior.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <html>
      <head>
      <title>Test Page    <!-- Noncompliant; title not closed -->
      <!-- Noncompliant; head not closed -->
      <body>
      <em>Emphasized Text  <!-- Noncompliant; em not closed -->
      <!-- Noncompliant; body not closed -->
      </html>
      ```

      ```html Fix theme={null}
      <html>
      <head>
      <title>Test Page</title>
      </head>
      <body>
      <em>Emphasized Text</em>
      </body>
      </html>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="HTML <table> should not be used for layout purposes">
    <div class="paragraph">
      <p>HTML \<table> elements should not be used for layout purpose as it can confuse screen readers. It is recommended to use CSS instead.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue on every <code>\<table> element containing a role attribute set to "presentation" or "none"</code>, which is how <a href="https://www.w3.org/WAI/tutorials/tables/tips/">W3C recommends</a> marks layout tables.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <table role="presentation">
      <!-- ... -->
      </table>
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Server-side image maps (ismap attribute) should not be used">
    <div class="paragraph">
      <p>The \`ismap attribute in an img tag creates a server-side image map: The browser sends the coordinates of the clicked point to the server.</p>
    </div>

    <div class="paragraph">
      <p>For any person who cannot use a mouse, this form of navigation is inaccessible because it is the position of the cursor on the image that determines the action.</p>
    </div>

    <div class="paragraph">
      <p>On the other hand, client-side image maps, which use the usemap\` attribute allow for each clickable area to specify an alternate text, enabling accessibility for the blind.</p>
    </div>

    <div class="paragraph">
      <p>Further, in terms of separation of concerns, it is definitely better to leave the task of mapping pixels to links to the client.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <a href="click_on_world_map.php" target="_self">
      <img src="world_map.png" ismap>              <!-- Noncompliant -->
      </a>
      ```

      ```html Fix theme={null}
      <img src="world_map.png" usemap="#world_map">

      <map name="world_map">
      <area shape="rect" coords="0,0,10,10" href="france.html" alt="France">
      <area shape="circle" coords="20,20,10" href="spain.html" alt="Spain">
      <area shape="circle" coords="30,30,8" href="england.html" alt="England">
      <!-- ... -->
      </map>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Tables should have headers">
    <div class="paragraph">
      <p>Table headers are essential to enhance the accessibility of a table’s data, particularly for assistive technologies like screen readers.
      These headers provide the necessary context to transform data into information.
      Without headers, users get rapidly lost in the flow of data.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue whenever a \<table> does not contain any \<th> elements.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <table role="presentation">
      <tr>
      <td>Name</td>
      <td>Age</td>
      </tr>
      <tr>
      <td>John Doe</td>
      <td>42</td>
      </tr>
      </table>
      ```

      ```html Fix theme={null}
      <table aria-hidden="true">
      <tr>
      <td>Name</td>
      <td>Age</td>
      </tr>
      <tr>
      <td>John Doe</td>
      <td>42</td>
      </tr>
      </table>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Links should not directly target images">
    <div class="paragraph">
      <p>Whenever a user clicks on a link that targets an image, the website’s navigation menu will be lost.</p>
    </div>

    <div class="paragraph">
      <p>From a user point of view, it is as if she left the website.</p>
    </div>

    <div class="paragraph">
      <p>The only way to return to it is using the browser’s 'Back' button.</p>
    </div>

    <div class="paragraph">
      <p>Instead, it is better to create a page which will display the image using the \`\<img> tag and preserve the navigation menu.</p>
    </div>

    <div class="paragraph">
      <p>Further, in terms of accessibility, when the image is embedded into a page, content providers are able to provide an alternate text equivalent through the alt\` attribute.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <a href="image.png">...</a>  <!-- Non-Compliant -->
      ```

      ```html Fix theme={null}
      <a href="page.html">...</a>  <!-- Compliant -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="input, select and textarea tags should be labeled">
    <div class="paragraph">
      <p>The \`\<label> tag defines a label for \<input>, \<select> and \<textarea> elements.</p>
    </div>

    <div class="paragraph">
      <p>The \<label> tag improves usability for visually impaired users: Screen readers will announce the label text whenever the focus is set on the input field.</p>
    </div>

    <div class="paragraph">
      <p>It also improves usability for users with impaired motor control: when the text within the \<label> element is clicked, the associated input field is toggled.</p>
    </div>

    <div class="paragraph">
      <p>In most cases, for attribute of the \<label> tag should be equal to the id attribute of the related element to bind them together.</p>
    </div>

    <div class="paragraph">
      <p>Sometimes the field is explained by an icon. In this case the label can be either hidden or the \<input>, \<select> or \<textarea> tags should contain one of the following attributes: aria-label, aria-labelledby. Screen-readers will use those attributes to describe the field.</p>
    </div>

    <div class="paragraph">
      <p>The purpose of this rule is to make sure that every input (except submit, button, image, and hidden inputs), select, and textarea\` field has a label.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <input type="text" name="firstname" />               <!-- Non-Compliant - no id -->

      <input type="text" name="lastname" id="lastname" />  <!-- Non-Compliant - no matching label for "lastname" -->

      <label for="address">Address</label>
      <input type="text" name="address" id="address" />    <!-- Compliant -->

      <input type="hidden" name="time" value="...">        <!-- Compliant - "hidden" type is excluded -->
      <input type="submit" value="Send" />                 <!-- Compliant - "submit" type is excluded -->
      ```

      ```html Fix theme={null}
      <label for="firstname">First name</label>
      <input type="text" name="firstname" id="firstname" />

      <label for="lastname">Last name</label>
      <input type="text" name="lastname" id="lastname" />

      <!-- OR -->

      <input type="text" name="firstname" aria-label="firstname">

      <div id="lastNameId">Last name</div>
      <input type="text" name="lastname"  aria-labelledby="lastNameId"/>

      <!-- still compliant -->

      <label for="address">Address</label>
      <input type="text" name="address" id="address" />

      <input type="hidden" name="time" value="...">
      <input type="submit" value="Send" />
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="The style attribute should not be used">
    <div class="paragraph">
      <p>The goal of this rule is to ban the usage of HTML "style" property to make sure that all CSS styles are defined in CSS classes. Consolidating all styling into classes makes it easier to read, understand and maintain.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <body>
      <h1 style="color: blue;">Hello World!</h1>  <!-- Noncompliant -->
      ```

      ```html Fix theme={null}
      <head>
      <style>
      h1 {
        color: blue;
      }
      </style>
      </head>
      <body>
      <h1>Hello World!</h1>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track uses of disallowed namespaces in XHTML documents">
    <div class="paragraph">
      <p>This rule allows to ban declaration of some namespaces in the root element of XHML documents.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"    <!-- Noncompliant -->
          xmlns:h="http://java.sun.com/jsf/html"  
          xmlns:f="http://java.sun.com/jsf/core">
      ```

      ```html Fix theme={null}
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"  
          xmlns:f="http://java.sun.com/jsf/core">
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<frames> should have a title attribute">
    <div class="paragraph">
      <p>Frames allow different web pages to be put together on the same visual space. Users without disabilities can easily scan the contents of all frames at once. However, visually impaired users using screen readers hear the page content linearly.</p>
    </div>

    <div class="paragraph">
      <p>The <code>title attribute is used to list all the page’s frames, enabling those users to easily navigate among them. Therefore, the \<frame> and \<iframe> tags should always have a title</code> attribute.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <frame src="index.php?p=menu">                                      <-- Non-Compliant -->
      <frame src="index.php?p=home" name="contents">                      <-- Non-Compliant -->
      ```

      ```html Fix theme={null}
      <frame src="index.php?p=menu" title="Navigation menu">              <-- Compliant -->
      <frame src="index.php?p=home" title="Main content" name="contents"> <-- Compliant -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<fieldset> tags should contain a <legend>">
    <div class="paragraph">
      <p>For users of assistive technology such as screen readers, it may be challenging to know what is expected in each form’s input. The input’s label alone might not be sufficient: 'street' could be part of a billing or a shipping address for instance.</p>
    </div>

    <div class="paragraph">
      <p>Fieldset legends are read out loud by screen readers before the label each time the focus is set on an input. For example, a legend 'Billing address' with a label 'Street' will read 'Billing address street'. Legends should be short, and 'Your' should not be repeated in both the legend and the label, as it would result in 'Your address Your City' being read.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <fieldset>                                 <!-- Noncompliant -->
      Street: <input type="text"><br />
      Town: <input type="text"><br />
      Country: <input type="text"><br />
      </fieldset>
      ```

      ```html Fix theme={null}
      <fieldset>
      <legend>Billing address</legend>
      Street: <input type="text"><br />
      Town: <input type="text"><br />
      Country: <input type="text"><br />
      </fieldset>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="<object> tags should provide an alternative content">
    <div class="paragraph">
      <p>Assistive technologies, such as screen readers, will not be able to render \`\<object> elements, in such cases it is the content of the \<object> which is provided to the user. This alternative content needs to be accessible or the screen readers won’t be able to use it. For example, if an \<img> is used it must contain an alt attribute (see corresponding rule Web:ImgWithoutAltCheck).</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when an \<object>\` tag does not have any alternative content.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <object></object> <!-- Noncompliant -->

      <object>
      <object></object> <!-- Noncompliant -->
      </object>
      ```

      ```html Fix theme={null}
      <object>This application shows the simulation of two particles colliding</object>

      <object>
      <img src="flower.png" alt="Flower growing in a pot" />
      </object>

      <object>
      <object>
      This application shows the simulation of two particles colliding
      </object>
      </object>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="aria-label or aria-labelledby attributes should be used to differentiate similar elements">
    <div class="paragraph">
      <p>If a page contains multiple \`\<nav> or \<aside> elements, each one should have an aria-label or aria-labelledby attribute so that they can be differentiated. The same rule applies when multiple elements have a role attribute with the same "landmark" value.</p>
    </div>

    <div class="paragraph">
      <p>Landmark roles are: banner, complementary, contentinfo, form, main, navigation, search, application\`. </p>
    </div>

    <div class="paragraph">
      <p>The use of ARIA markup helps users of screen readers navigate across blocks of content. For example it makes groups of links easier to locate or skip.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <nav> <!-- Noncompliant -->
      <ul>
          <li>A list of navigation links</li>
      </ul>
      </nav>

      <article>
      <nav> <!-- Noncompliant -->
          Another list of navigation links
      </nav>
      </article>
      ```

      ```html Fix theme={null}
      <div id="mainnav" role="navigation"> <!-- Noncompliant -->
      <h2 id="mainnavheading">Site Navigation</h2>
      <ul>
         <li>List of links</li> 
      </ul>
      </div>
      <div id="secondarynav" role="navigation"> <!-- Noncompliant -->
      <h2 id="secondarynavheading">Related links</h2>
      <ul>
         <li>List of links</li>
      </ul>
      </div>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Locale should be specified for String case conversion">
    <div class="paragraph">
      <p>Failure to specify a locale for <code>String</code> case conversions means the system default encoding will be used, possibly creating problems with international characters. Such code may work fine in its "home" environment, but break in ways that are extremely difficult to diagnose for customers who use different encodings. Such bugs can be nearly, if not completely, impossible to reproduce when it’s time to fix them.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      String myStr = "José is a nice guy.";
      String myUcString = myStr.toUpperCase(); // Noncompliant
      ```

      ```html Fix theme={null}
      String myStr = "José is a nice guy.";
      String myUcString = myStr.toUpperCase(Locale.US);
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Videos should have subtitles">
    <div class="paragraph">
      <p>In order to make your site usable by as many people as possible, subtitles should be provided for videos.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when a \`video does not include at least one \<track/> tag with the kind attribute set to captions, or descriptions or at the very least subtitles.</p>
    </div>

    <div class="paragraph">
      <p>Note that the subtitles kind is not meant for accessibility but for translation. The kind captions targets people with hearing impairment, whereas descriptions\` targets people with vision impairment.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <video id="video" controls preload="metadata">
      <source src="resources/myvideo.mp4" type="video/mp4">
      <source src="resources/myvideo.webm" type="video/webm">
      </video>
      ```

      ```html Fix theme={null}
      <video id="video" controls preload="metadata">
      <source src="resources/myvideo.mp4" type="video/mp4">
      <source src="resources/myvideo.webm" type="video/webm">
      <track label="English" kind="captions" srclang="en" src="resources/myvideo-en.vtt" default>
      <track label="Deutsch" kind="captions" srclang="de" src="resources/myvideo-de.vtt">
      <track label="Español" kind="captions" srclang="es" src="resources/myvideo-es.vtt">
      </video>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Dynamic includes should not be used">
    <div class="paragraph">
      <p>Content that doesn’t change or that doesn’t change often should be included using a mechanism which won’t try to interpret it. Specifically, <code>\<%@ include file="..." %>, which includes the file in the JSP servlet translation phase (i.e. it happens once), should be used instead of \<jsp:include page="..." /></code>, which includes the page on the file, when the content is being served to the user.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <jsp:include page="header.jsp">  <!-- Noncompliant -->
      ```

      ```html Fix theme={null}
      <%@ include file="header.jsp" %>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="HTML comments should be removed">
    <div class="paragraph">
      <p>ts in a page that will be generated or interpolated server-side before being served to the user increases the risk of exposing data that should be kept private. For instance, a developer comment or line of debugging information that’s left in a page could easily (and has) inadvertently expose:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Version numbers and host names</p>
        </li>

        <li>
          <p>Full, server-side path names</p>
        </li>

        <li>
          <p>Sensitive user data</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Every other language has its own native comment format, thus there is no justification for using HTML-style comments in anything other than a pure HTML or XML file.</p>
    </div>

    <CodeGroup>
      ```html Bad theme={null}
      <%-- Replace 'world' with name --%>  // Compliant
        <h2>Hello world!</h2>
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Labels should be defined in the resource bundle">
    <div class="paragraph">
      <p>Web applications can be made available in multiple languages through the use of internationalization. This allows the server to plug in the correct version of a piece of text based on the language chosen, but it requires that internationalization messages be used instead of hard-coded text.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <form method="post">
      <label for="username">Username:</label>  <!-- Noncompliant -->
      <input type="text" id="username" name="username">

      <label for="password">Password:</label>  <!-- Noncompliant -->
      <input type="password" id="password" name="password">

      <input type="submit" name="submit" value="${buttonValue}">
      </form>
      ```

      ```html Fix theme={null}
      <form method="post">
      <label for="username"><fmt:message key="login.label.username" />:</label>
      <input type="text" id="username" name="username">

      <label for="password"><fmt:message key="login.label.password" />:</label>
      <input type="password" id="password" name="password">

      <input type="submit" name="submit" value="${buttonValue}">
      </form>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Links with identical texts should have identical targets">
    <div class="paragraph">
      <p>When links with different targets are given identical link text, this can produce confusion for users of assistive technologies, some of which provide users the ability to view a list of all links on the page.</p>
    </div>

    <div class="paragraph">
      <p>When this list of links is presented to the user they may be left not knowing the links go to different destinations.</p>
    </div>

    <div class="paragraph">
      <p>Even if they do realize the links go to different destinations, they may be left not knowing which link to follow to go to the destination they desire.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <a href="a.html">qux</a>
      <a href="b.html">qux</a>          <!-- Noncompliant; same text, different targets -->

      <a href="c.html">foo</a>
      <a href="d.html">foo</a>          <!-- Noncompliant; same text, different targets -->
      ```

      ```html Fix theme={null}
      <a href="a.html">qux</a>
      <a href="b.html">qaz</a>          <!-- Compliant; different text, different targets -->

      <a href="c.html">foo</a>
      <a href="c.html">foo</a>          <!-- Compliant; same text, same targets -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Favicons should be used in all pages">
    <div class="paragraph">
      <p>Favicons are shown for example in the browser’s address bar, bookmark list, or tabs.</p>
    </div>

    <div class="paragraph">
      <p>They enable users to quickly identify and recognize websites.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <head>                                                                  <!-- Noncompliant -->
      <title>...<title>
      </head>
      ```

      ```html Fix theme={null}
      <head>
      <title>...<title>
      <link rel="shortcut icon" href="http://example.com/myicon.ico" />
      </head>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Mouse events should have corresponding keyboard events">
    <div class="paragraph">
      <p>Offering the same experience with the mouse and the keyboard allow users to pick their preferred devices.</p>
    </div>

    <div class="paragraph">
      <p>Additionally, users of assistive technology will also be able to browse the site even if they cannot use the mouse.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>an HTML element with an \`onMouseover attribute doesn’t also have an onFocus attribute.</p>
        </li>

        <li>
          <p>an HTML element with an onMouseout attribute doesn’t also have an onBlur attribute.</p>
        </li>

        <li>
          <p>an HTML element with an onClick attribute doesn’t also have one of the following attributes: onKeyDown, onKeyUp, onKeyPress.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Note that in the case of onClick\`, the equivalent keyboard handler should support both the "Enter" and "Space" keys as these are usually used by screen-readers.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <div onClick="doSomething();" ...>                                <!-- Noncompliant - 'onKeyDown/onKeyUp/onKeyPress' missing -->
      <a onMouseover="doSomething();" ...>                            <!-- Noncompliant - 'onFocus' missing -->
      <a onMouseout="doSomething();" ...>                             <!-- Noncompliant - 'onBlur' missing -->
      ```

      ```html Fix theme={null}
      <div onClick="doSomething();" onKeyDown="doSomething();" tabindex="0" ...>    <!-- Compliant -->
      <a onMouseover="doSomething();" onFocus="doSomething();" ...>   <!-- Compliant -->
      <a onMouseout="doSomething();" onBlur="doSomething();" ...>     <!-- Compliant -->
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Unescaped JSON data should not be written to the output">
    <div class="paragraph">
      <p>In cross-site scripting attacks, attackers insert attack scripts into your pages. Because no system is fool-proof, it may not be enough to screen the data that’s submitted to an application. You should also escape any content sent to the user so that any malicious code that may have escaped your input screening is neutralized. Specifically, the characters crucial to forming HTML (\`&, \<, >, ", ', and /) must be escaped.</p>
    </div>

    <div class="paragraph">
      <p>This rule checks that values are not written directly into application/json\` blocks or JavaScript variables.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <script id="data" type="application/json">
      <%= data.json_payload %>  // Noncompliant
      <script>

      <script>
      var initialData = <%= data.json_payload =>;  // Noncompliant
      </script>
      ```

      ```html Fix theme={null}
      <script id="data" type="application/json">
      <c:out value="${data.json_payload}">  // by default, escapeXML="true" but it can also be specified explicitly
      <script>

      <script>
      var initialData = <%= escape_html(data.json_payload) =>;
      </script>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Unused values should not be calculated">
    <div class="paragraph">
      <p>Calculating or retrieving a value only to then overwrite it or throw it away, could indicate a serious error in the code. Even if it’s not an error, it is at best a waste of resources. Therefore all calculated values should be used.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      void calculateRate(int a, int b)
      {
      int i;

      i = a + b; // Noncompliant; calculation result not used before value is overwritten
      i = doSomething();  // Noncompliant; retrieved value not used
      for (i = 0; i < 10; i++) { 
      //  ...
      }
      // ...
      }
      ```

      ```html Fix theme={null}
      void calculateRate(int a, int b)
      {
      int i;

      i = doSomething();
      i += a + b;
      storeI(i)

      for (i = 0; i < 10; i++) { 
      //  ...
      }
      }
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Multiple page directives should not be used">
    <div class="paragraph">
      <p>While you can use as many <code>page</code> directives as you like, it is more readable to set multiple page attributes in a single directive.</p>
    </div>

    <div class="paragraph">
      <p>The exception to this rule is when multiple packages are being imported. In that case, imports may be done in separate directives and all other attributes should be set in a single, additional directive.</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <%@ page session="false" %>
      <%@ page import="java.util.*" %>
      <%@ page errorPage="error.jsp" %> <!-- Noncompliant -->
      <%@ page import="java.text.*" %>
      ```

      ```html Fix theme={null}
      <%@ page session="false"
                     errorPage="error.jsp" %>
      <%@ page import="java.util.*" %>
      <%@ page import="java.text.*" %>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Attributes deprecated in HTML5 should not be used">
    <div class="paragraph">
      <p>HTML5 is the fifth and current major version of HTML.
      HTML5 introduced many new elements, attributes, and behaviors.
      While HTML5 also aimed to be backward-compatible with common parsing of older versions of HTML, many old attributes were deprecated.</p>
    </div>

    <div class="paragraph">
      <p>The main reason these attributes were deprecated in HTML5 is to separate the concerns of content structure (HTML) and presentation (CSS).
      This is a fundamental principle of modern web design known as the separation of concerns, which provides multiple advantages:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>Maintainability: By separating content and presentation, you can change the look and feel of a website without touching the HTML. You only need to modify the CSS.</p>
        </li>

        <li>
          <p>Reusability: CSS styles can be reused across multiple pages, making it easier to keep a consistent look and feel across an entire website.</p>
        </li>

        <li>
          <p>Accessibility: Using CSS for presentation makes it easier to create websites that are accessible to users with disabilities. For example, screen readers can more easily interpret web content when it’s separated from the presentation.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <table>
      <tr>
      	<td width="50%">1st cell</td><!-- Noncompliant: 'width' attribute is deprecated -->
      	<td width="50%">1st cell</td>
      </tr>
      </table>
      ```

      ```html Fix theme={null}
      <style>
      .equal-width td { width: 50%; }
      </style>
      <table class="equal-width">
      <tr>
      	<td>1st cell</td>
      	<td>2nd cell</td>
      </tr>
      </table>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="White space should be used in JSP/JSF tags">
    <div class="paragraph">
      <p>The proper use of white space makes a major contribution to code readability.</p>
    </div>

    <div class="paragraph">
      <p>This rule raises an issue when there is not a space character after the beginning and before the end of each comment (<code>\<!-- ... -->), directive (\<%@ ... %>), and expression (\<% ... %></code>).</p>
    </div>

    <div class="paragraph" />

    <CodeGroup>
      ```html Bad theme={null}
      <!--Do the thing-->  <!-- Noncompliant; missing space at beginning and end of text-->
      <%@page import="java.io.*,java.util.*" %> <!-- Noncompliant; missing space at beginning -->
      <% String title = "My Page";%> <!-- Noncompliant; missing space at end -->
      ```

      ```html Fix theme={null}
      <!-- Do the thing -->
      <%@ page import="java.io.*,java.util.*" %>
      <% String title = "My Page"; %>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Authorizing an opened window to access back to the originating window is security-sensitive">
    <div class="paragraph">
      <p>A newly opened window having access back to the originating window could allow basic phishing attacks (the <code>window\.opener object is not null and thus window\.opener.location</code> can be set to a malicious website by the opened page).</p>
    </div>

    <div class="paragraph">
      <p>For instance, an attacker can put a link (say: "[http://example.com/mylink](http://example.com/mylink)") on a popular website that changes, when opened, the original page to "[http://example.com/fake\_login](http://example.com/fake_login)". On "[http://example.com/fake\_login](http://example.com/fake_login)" there is a fake login page which could trick real users to enter their credentials.</p>
    </div>

    <CodeGroup>
      ```html Bad theme={null}
      <a href="http://example.com/dangerous" target="_blank"> <!-- Sensitive -->

      <a href="{{variable}}" target="_blank"> <!-- Sensitive -->
      ```

      ```html Fix theme={null}
      <a href="http://petssocialnetwork.io" target="_blank" rel="noopener">
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track lack of copyright and license headers">
    <div class="paragraph">
      <p>Each source file should start with a header stating file ownership and the license which must be used to distribute the application.</p>
    </div>

    <div class="paragraph">
      <p>This rule must be fed with the header text that is expected at the beginning of every file.</p>
    </div>

    <CodeGroup>
      ```html Bad theme={null}
      <html>                                    <!-- Noncompliant -->
      ...
      </html>
      ```

      ```html Fix theme={null}
      <!-- Copyright 2013 SonarSource SA -->
      <html>
      ...
      </html>
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Track uses of TODO tags">
    <div class="paragraph">
      <p>Developers often use TODO tags to mark areas in the code where additional work or improvements are needed but are not implemented immediately.
      However, these TODO tags sometimes get overlooked or forgotten, leading to incomplete or unfinished code.
      This rule aims to identify and address unattended TODO tags to ensure a clean and maintainable codebase.
      This description explores why this is a problem and how it can be fixed to improve the overall code quality.</p>
    </div>

    <CodeGroup>
      ```html Bad theme={null}
      <html>
      <!-- TODO support small device -->
      ...
      </html>
      ```

      ```html Fix theme={null}
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Using remote artifacts without integrity checks is security-sensitive">
    <div class="paragraph">
      <p>Using remote artifacts without integrity checks can lead to
      the unexpected execution of malicious code in the application.</p>
    </div>

    <div class="paragraph">
      <p>On the client side, where front-end code is executed, malicious code could:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>impersonate users' identities and take advantage of their privileges on the application.</p>
        </li>

        <li>
          <p>add quiet malware that monitors users' session and capture sensitive secrets.</p>
        </li>

        <li>
          <p>gain access to sensitive clients' personal data.</p>
        </li>

        <li>
          <p>deface, or otherwise affect the general availability of the application.</p>
        </li>

        <li>
          <p>mine cryptocurrencies in the background.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>Likewise, a compromised software piece that would be deployed on a server-side application could badly affect the application’s security. For example, server-side malware could:</p>
    </div>

    <div class="ulist">
      <ul>
        <li>
          <p>access and modify sensitive technical and business data.</p>
        </li>

        <li>
          <p>elevate its privileges on the underlying operating system.</p>
        </li>

        <li>
          <p>Use the compromised application as a pivot to attack the local network.</p>
        </li>
      </ul>
    </div>

    <div class="paragraph">
      <p>By ensuring that a remote artifact is exactly what it is supposed to be before
      using it, the application is protected from unexpected changes applied to it before it is
      downloaded.
      Especially, integrity checks will allow for identifying an artifact replaced by malware on the
      publication website or that was legitimately changed by its author, in a more benign
      scenario.</p>
    </div>

    <div class="paragraph">
      <p>Important note: downloading an artifact over HTTPS only protects it while in
      transit from one host to another. It provides authenticity and integrity checks
      <strong>for the network stream</strong> only. It does not ensure the authenticity or security
      of the artifact itself.</p>
    </div>

    <CodeGroup>
      ```html Bad theme={null}
      <script
      src="https://cdn.example.com/latest/script.js"
      ></script> <!-- Sensitive -->
      ```

      ```html Fix theme={null}
      <script 
      src="https://cdn.example.com/v5.3.6/script.js"
      integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
      ></script>
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
