My HTML:
<p id="text">test</p>
My CSS:
#test {
margin-top: 0;
margin-bottom: 0;
font-size: 0.7em;
text-align: center;
}
How do I avoid this warning on WAVE accessibility tool? This is one the requirement to keep this text small.
My HTML:
<p id="text">test</p>
My CSS:
#test {
margin-top: 0;
margin-bottom: 0;
font-size: 0.7em;
text-align: center;
}
How do I avoid this warning on WAVE accessibility tool? This is one the requirement to keep this text small.
No.
No and neither should you try and avoid warnings, you should fix them.
No.
This warning is in place because people with low vision struggle to read tiny fonts. (and even those with perfect vision don't want to have to squint to read things - it is a bad user experience all around!)
You shouldn't try to fix warnings, you should address the problem.
If there is a requirement to keep text small it is the requirement that needs changing.
Either adjust the design to incorporate large text if the layout isn't large enough to fit the text at a larger size (1 rem minimum size) or change the brief and explain why the text needs to be larger if it is a spec requirement.
If it is a layout issue you also have to bear in mind that by using em
units you already have to accommodate larger text as the user may have their browser font size set to very large and em
units will scale in relation to that.
Wave reports errors for text smaller than 10px. For standard browsers 0.7em is equivalent to 11px if you don't nest tags. You can base your font on the rem
unity instead of em
or use the px
unity (which is totally valid for accessibility as it represents CSS pixels not physical pixels). That being said answer from Graham Ritchie give you the good way to handle the situation : do not try to solve the problem by hiding the warning.