* Translation fix Changed the term "portas de visualização" back to "viewport", because it is a technical term, and when translated it loses its meaning * Changes in the blockquote tag The code inside the blockquote tag was translated to portuguese, but code shouldn't be translated because then it doesn't work, so I changed it to the same code of the English version of the challenge. Also, I changed "A Camper Cat" to "O Camper Cat" in the line 13 because on other pages Camper Cat is referred as male, so it makes more sense to use the article "O" in portuguese.
5.9 KiB
5.9 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d778d367417b2b2512aaa | Make Elements Only Visible to a Screen Reader by Using Custom CSS | 0 | Tornar os elementos visíveis apenas para um leitor de tela usando CSS personalizado |
Description
.sr-only {Nota
position: absolute;
left: -10000px;
width: 1px;
height: 1px;
top: auto;
overflow: hidden;
}
As seguintes abordagens CSS NÃO farão o mesmo:
-
display: none;
ouvisibility: hidden;
oculta conteúdo para todos, incluindo usuários de leitores de tela - Valores zero para tamanhos de pixel, como
width: 0px; height: 0px;
remove esse elemento do fluxo do seu documento, o que significa que os leitores de tela o ignoram
Instructions
sr-only
, mas as regras CSS ainda não foram preenchidas. Atribua à position
um valor absoluto, a left
um valor de -10000px e a width
e a height
ambos os valores de 1px. Tests
tests:
- text: Seu código deve definir a propriedade de <code>position</code> da classe <code>sr-only</code> para um valor absoluto.
testString: 'assert($(".sr-only").css("position") == "absolute", "Your code should set the <code>position</code> property of the <code>sr-only</code> class to a value of absolute.");'
- text: Seu código deve definir a propriedade <code>left</code> da classe <code>sr-only</code> para um valor de -10000px.
testString: 'assert($(".sr-only").css("left") == "-10000px", "Your code should set the <code>left</code> property of the <code>sr-only</code> class to a value of -10000px.");'
- text: Seu código deve definir a propriedade <code>width</code> da classe <code>sr-only</code> para um valor de 1 pixel.
testString: 'assert(code.match(/width:\s*?1px/gi), "Your code should set the <code>width</code> property of the <code>sr-only</code> class to a value of 1 pixel.");'
- text: Seu código deve definir a propriedade <code>height</code> da classe <code>sr-only</code> para um valor de 1 pixel.
testString: 'assert(code.match(/height:\s*?1px/gi), "Your code should set the <code>height</code> property of the <code>sr-only</code> class to a value of 1 pixel.");'
Challenge Seed
<head>
<style>
.sr-only {
position: ;
left: ;
width: ;
height: ;
top: auto;
overflow: hidden;
}
</style>
</head>
<body>
<header>
<h1>Training</h1>
<nav>
<ul>
<li><a href="#stealth">Stealth & Agility</a></li>
<li><a href="#combat">Combat</a></li>
<li><a href="#weapons">Weapons</a></li>
</ul>
</nav>
</header>
<section>
<h2>Master Camper Cat's Beginner Three Week Training Program</h2>
<figure>
<!-- Stacked bar chart of weekly training-->
<p>[Stacked bar chart]</p>
<br />
<figcaption>Breakdown per week of time to spend training in stealth, combat, and weapons.</figcaption>
</figure>
<table class="sr-only">
<caption>Hours of Weekly Training in Stealth, Combat, and Weapons</caption>
<thead>
<tr>
<th></th>
<th scope="col">Stealth & Agility</th>
<th scope="col">Combat</th>
<th scope="col">Weapons</th>
<th scope="col">Total</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Week One</th>
<td>3</td>
<td>5</td>
<td>2</td>
<td>10</td>
</tr>
<tr>
<th scope="row">Week Two</th>
<td>4</td>
<td>5</td>
<td>3</td>
<td>12</td>
</tr>
<tr>
<th scope="row">Week Three</th>
<td>4</td>
<td>6</td>
<td>3</td>
<td>13</td>
</tr>
</tbody>
</table>
</section>
<section id="stealth">
<h2>Stealth & Agility Training</h2>
<article><h3>Climb foliage quickly using a minimum spanning tree approach</h3></article>
<article><h3>No training is NP-complete without parkour</h3></article>
</section>
<section id="combat">
<h2>Combat Training</h2>
<article><h3>Dispatch multiple enemies with multithreaded tactics</h3></article>
<article><h3>Goodbye, world: 5 proven ways to knock out an opponent</h3></article>
</section>
<section id="weapons">
<h2>Weapons Training</h2>
<article><h3>Swords: the best tool to literally divide and conquer</h3></article>
<article><h3>Breadth-first or depth-first in multi-weapon training?</h3></article>
</section>
<footer>© 2018 Camper Cat</footer>
</body>
Solution
// solution required