Issue with "::first-letter (:first-letter)": (Google search result header does not show properly for pseudo-classes)
See original GitHub issueMDN URL: https://developer.mozilla.org/en-US/docs/Web/CSS/::first-letter
What information was incorrect, unhelpful, or incomplete?
When we search for any pseudo-class on Google, It ignores some of the first keywords while showing MDN in the results list.
Specific section or headline?
For instance, the result should show something like ::before (:before) - CSS: Cascading Style Sheets - MDN Web Docs
. But instead, it ignores “::before (:” part in the results.
What did you expect to see?
Some result header like ::before (:before) - CSS: Cascading Style Sheets - MDN Web Docs
should show in the results. It seems to be some issue in SEO.
Did you test this? If so, how?
Checked on different search Engines by searching the same text “css before”. Search engines tested on:
- Google: failed
- Duckduckgo: passed
- Dogpile: passed
- Yandex: passed (shows
before
instead of::before
)
MDN Content page report details
- Folder:
en-us/web/css/_doublecolon_first-letter
- MDN URL: https://developer.mozilla.org/en-US/docs/Web/CSS/::first-letter
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/css/_doublecolon_first-letter/index.md
- Last commit: https://github.com/mdn/content/commit/26f50bdaeb1228f458d21dbdf7dc110387b20daa
- Document last modified: 2021-08-12T23:59:09.000Z
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
first-letter - CSS: Cascading Style Sheets - MDN Web Docs
The ::first-letter CSS pseudo-element applies styles to the first letter of the first line of a block-level element, but only when not ......
Read more >CSS :first-letter not working - Stack Overflow
The ::first-letter CSS pseudo-element selects the first letter of the first line of a block, if it is not preceded by any other...
Read more >linkedin-skill-assessments-quizzes/css-quiz.md at main - GitHub
Using the :nth-child pseudo class, what would be the most efficient way to style every third item in a list, no matter how...
Read more >text containing first-letter CSS style can't be selected/searched
1. Select the text containing first letter styled with first-letter CSS. ("Přijeďte" in the first paragraph, in this case). ... What is the...
Read more >CSS/Selectors/pseudo-elements/:first-letter - W3C Wiki
The ::first-letter pseudo-element represents the first letter of an element, if it is not preceded by any other content (such as images or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m guessing this is Google rewriting page titles. It appears that Google is stripping out the colons. I’d guess there’s some strategy here to strip needless separators from titles, which has swallowed actual content here.
Reading their docs, I’m not sure we can do anything about this. It sounds like the biggest thing we might be able to do would be to shorten the title so that there’s less incentive for Google to trim it, though I don’t know if that’s particularly desirable for readers.
I’ve tagged this as help wanted. If someone knows a bit more about SEO, I’d welcome some more concrete (and substantiated by evidence) suggestions for avoiding this.
Spun up a small demo at https://tannerdolby.com/seo-demo, once its been indexed by Google, having a look at SEO results in the browser should display the
<title>: ...
content now that we are using a character entity to represent colon like<title><title>:</title>
where the colon shouldn’t get recognized as a separator. If anyone can manage to get the page displayed in SEO results, do share a screenshot so we all can see.If we can’t find a way to use an HTML entity to represent the
:
in<title>
's, then the issue will persist. Where the last resort would be removing the colon as a separator in titles where it would be<title> The Document Title Element
instead of<title>: The Document Title Element
which I do think looks more readable with the colon but if it continues to cause problems for Chrome could be an option.