How do you search DOM elements using CSS selectors in Chrome?

How do search engines index text on websites using ::before and ::after pseudo selectors (CSS)?

  • Answer:

    Most probably don't (Google doesn't seem to). CSS generated content is, by its nature, entirely presentational. I'd argue that it would almost never contain any keywords that users may be searching for, although perhaps including it could slightly improve the readability of snippets. Google could easily index generated content if they wanted to do so. Googlebot is not at all blind to page style and layout—for example, Google has acknowledged that the Googlebot can tell which content on a page is "above the fold" (http://www.seroundtable.com/google-page-layout-seo-14288.html). Google is already parsing CSS to do this, so it would be fairly trivial for them to dump the ::before and ::after generated content from that CSS into the text representation of the page that they index. Disclaimer: I used to work for Google but not on search or indexing, etc. Everything in this answer is based on publicly available information.

David Bloom at Quora Visit the source

Was this solution helpful to you?

Other answers

For the most part I agree with . That said, with a CMS and/or / keywords and other relevant content can easily become part of an interaction managed with such pseudo-selectors. Agreed, it probably doesn't happen all that offen. None the less there could be practical use cases for such flexibility. On the whole I believe it's best to presume that Google can and will do whatever is necessary to match the best content to the searcher and their keywords. From parsing CSS to bot'ing content "hidden" by AJAX, they have the talent, the want and the need for perpetual improvement.

Mark Simchock

I wouldn't expect search engines to index that text. The more expensive it is to crawl your page, and parsing CSS and running javascript are both expensive, the less likely search engines are to do it unless you're a very important webpage.

Greg Lindahl

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.