0

I have a website with a rather complicated input form, which can vary a lot (it has different fields depending on what the user has entered until now). When I was making the CSS, I noticed that there is a div which will not render when it's empty, and due to the complicated structure, break all the other divs around it - but it is legal for it to be empty. In fact, it not only needs to have content, but also to have at least enough content to be as high as the neighboring div for the design to align properly.

The hack I came up with was to use a css::after pseudo-element, and stuff it with several paragraphs of content. I gave the text an invisible color, rgba(0, 0, 0, 0), so it won't appear to the user. I know this is an ugly hack, but I'm not good at CSS (we have no professional designer), the site is really complicated, and the project is already late.

Now I read somewhere that search engines think that this is a trick to add more keywords to a website, and penalize invisible text severely. Is this always true? Will this thing trip me up? Do they ever notice text which is added in a CSS::after element instead in the normal markup?

This is only there on the input form, which Google doesn't have to index. But I wonder if it will penalize the whole site if it ever gets on it?

I am just using a few paragraphs of pure Lorem Ipsum. No links in it, no keywords, nothing. It is only there for the alignment.

  • Could theoretically cause you problems. Not likely, but possible. Is there a reason you can't fill all that "content" with blank spaces, instead of lorem ipsum? Maybe a long series of   ? – nathangiesbrecht Sep 30 '14 at 14:56
1

Google doesn't index text that is contained in CSS. Google only cares about text that it indexes that users then can't find when they land on your site. You should be fine.

To be doubly sure that it won't cause problems, use symbols like = = = = = = = = = = = =... to fill up the div. Even if Google does end up indexing CSS after text at some point, they won't index non-words.

1

Webmasters use CSS to design their websites without using HTML and they are also using techniques to hide the content from web crawlers.

But, you need to know that Search engines do not want to be fooled by designers and that is why they have started indexing CSS files. When crawlers finds something messy and stuffed, they may penalize it.

The only rule in internet marketing is not to cheat the Google bots. If you do something spammy and think that you will never get caught then you are wrong.

  • As I mentioned, I am not doing anything spammy. I am afraid that it shares some superficial features with what spammers do, so Google might misrecognize it, so I'm asking whether it is different enough from spam to be recognized by the bots as being non-malicious. – Rumi P. Oct 1 '14 at 10:55
  • Yes, Google may misrecognize it so, it is good to do things clear which will be good for you as well as for bots. – Vinay Aggarwal Oct 1 '14 at 10:57
  • So, as far as I read your answer, it says "it could be", but nothing more concrete than that. This was already the stand of my knowledge when I asked the question. Do you have more information about how likely it is to be seen as spam, or what I could do to distinguish it better from actual spam (beyond completely removing it, which would cost me a lot in resources I don't really have, primarily time)? – Rumi P. Oct 1 '14 at 11:15
  • Can you tell me, what kind of text you want to insert in CSS that you cannot do it in text? – Vinay Aggarwal Oct 1 '14 at 11:28
  • I could insert it in text too, but this would require me to manually go into the markup everywhere where it's needed and insert the replacement. Or write Java Script to insert it. In the CSS, it's all in one place. And besides, it's not content, it's there to make the looks work, so semantically it belongs in the CSS. – Rumi P. Oct 1 '14 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.