Mobile app version of vmapp.org
Login or Join
Frith620

: Hiding the text that is already shown in a preview image I've got a page, in which I have a preview of a document, as JPG. Also, I've got the content read of that image. I am doing it

@Frith620

Posted in: #HiddenText #Html #Images #Seo

I've got a page, in which I have a preview of a document, as JPG. Also, I've got the content read of that image.

I am doing it like this, but I have no idea if this is a way Google won't hate me:

<div class="image-container">
<img src="preview.doc.jpg" />
<hidden style="display:none">
Lots of text which is in preview.doc, but the image above actually
says this text, but as an image because a word document
cannot be shown in a browser,
but it's alot which I do not want to show to the user because the data in here is actually rendered nicely above
as a word document with all styling.
</hidden>
</div>


Is this the way to do it, or should I do it in another way?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Frith620

2 Comments

Sorted by latest first Latest Oldest Best

 

@Courtney195

It looks a bit long, but I suppose you could just drop it into the image's alt attribute.

<div class="image-container">
<img
src="preview.doc.jpg"
alt="Lots of text which is in preview.doc, but the image above actually says this text, but as an image because a word document cannot be shown in a browser, but it's alot which I do not want to show to the user because the data in here is actually rendered nicely above as a word document with all styling."
/>
</div>


It's a bit tough not knowing the purpose of keeping the .DOC (instead of just pasting/formatting the content online) but this wouldn't be entirely out of the realm of use of alt attributes.

Unconventional? Sure. Better than a hidden DIV? I'd say almost certainly.

10% popularity Vote Up Vote Down


 

@Frith620

If you want to follow best practice as far as Google's Guidelines are concerned, you should be showing everyone the exact same content - users and bots alike.
An alternative would be to place the content in HTML on the page, underneath the image, but use an accordion / dropdown / click to expand type thing so that the text would be "hidden" unless clicked on and won't affect the UX of the page.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme