Skip to content

Instantly share code, notes, and snippets.

@stevebosworth
Last active March 21, 2017 17:34
Show Gist options
  • Save stevebosworth/7a2fa4b98cdc8ce6a6c1d1805a282e4c to your computer and use it in GitHub Desktop.
Save stevebosworth/7a2fa4b98cdc8ce6a6c1d1805a282e4c to your computer and use it in GitHub Desktop.
a11y-examples-sale-price
{% if product.compare_at_price > product.price %>
<span class=”visually-hidden”>Regular Price</span>
<span id=”ComparePrice”> $100</span>
<span class=”visually-hidden”>Sale price</span>
{% endif %}
<span id=”ProductPrice” itemprop=”price”>$50</span>
<style>
.visually-hidden {
position: absolute !important;
overflow: hidden;
clip: rect(0 0 0 0);
height: 1px;
width: 1px;
margin: -1px;
padding: 0;
border: 0;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment