I have a site that is using the background image feature extensively to replace text with a graphic which contains that text in a stylized form.
For accessibility and SEO purposes I have the actual text included in the HTML, but I do not want it to show for most users.
What is the best approach to go about this? There are recommendations out there to use off-screen placement, but others warn against this being black-hat. Then there is the option to use something like
@media all {
.mybox{visibility:visible;}
}
@media not speech {
.mybox{visibility:hidden;}
}
but I have never seen that used or recommended.
What is the current best practice for this?
My HTML looks like this:
<div class="SFM_TextBox" id="SFM_Block_4_3_B">
<div class="SFM_Tooltip">Your strategy will be tuned to your business.</div>
</div>
And my CSS looks like this:
#SFM_Block_4_3_B {
background-image: url(images/strategy.png);
background-repeat: no-repeat;
background-size: 80% 80%;
background-position: center; }
The class SFM_Tooltip
is the one I want to hide. It is called tooltip because I was playing with that option at first, but it is just visually distracting to have a tooltip with the same text that is in the image already.
background-image
directive found in CSS, or are you putting background images in using another method? – dhaupin May 6 '15 at 17:35background-image
. See the update above. – Sebastian Meine May 6 '15 at 17:51#SFM_Block_4_3_B .SFM_Tooltip::after
inside of an@media speech
then set acontent
directive containing the text...not too familiar with the speech module for CSS though, would it read fromcontent
? Advantage (if it works) is that it would dynamically display based on the @media...no hiding off page required in that case, and the content would totally be non-existent until a screen reader hit it. Another thought, do browsers even support@media speech
yet? – dhaupin May 6 '15 at 18:27use off-screen placement, but others warn against this being black-hat
lies... only when becomes black hat when you have no way of triggering the element into the view point. – Simon Hayter♦ May 6 '15 at 20:23