Everyone knows that the div+css layout is very popular now. CSS separates the content and presentation of the web page, streamlines the web page code, changes a few codes, and creates a new web page style, haha! Needless to say, the opening speed! But from an SEO perspective, hidden text is SEO cheating! ! Is css perfect as mentioned above? I’m not sure, so let’s discuss whether css image can perfectly replace the tag img? Of course that includes alt!
1. The html code of pictures in general web pages is as follows:
<h1>
<img src="images/logo.jpg" alt="logo name" />
</h1>
2. If you use css instead, first write a piece of css code (where .logo is the class selector):
h1.main-logo {
width: 300px; height: 50px;
background: url(images/logo.jpg);
text-indent: -9999px;
}
When you call css on a web page, the code is as follows:
<h1 class="main-logo">Logo name</h1>
The above two expression methods are exactly the same, but the way the CSS expresses the image will make the words "Logo name" hidden in the text. From an SEO perspective, is this cheating? (SEO experts please leave a message!)
Why does everyone like to use this css? I won’t explain the reason, it’s been mentioned before! But do search engines understand? Although the opening speed of web pages is friendly to users, can search engines understand? As we all know, search engines only recognize text, not images! Using CSS, it is obvious that the text is hidden. Search engines will severely punish SEO cheating of hidden text! But using CSS is technically reasonable. Can Google and other search engines understand it?
Let’s see what Matt Cutts, a senior senior engineer at Google, has to say?
If you're straight-out using CSS to hide text, don't be surprised if that is called spam. I'm not saying that mouseovers or DHTML text or have-a-logo-but-also-have-text is spam ; I answered that last one at a conference when I said “imagine how it would look to a visitor, a competitor, or someone checking out a spam report. If you show your company's name and it's Expo Markers instead of an Expo Markers logo, you should be fine. If the text you decide to show is 'Expo Markers cheap online discount buy online Expo Markers sale …' then I would be more cautious, because that can look bad.
It can be seen from his words that if you deliberately use CSS to play SEO, haha, that would be a bit dangerous! If it is reasonable to use CSS to improve user-friendliness, then there is nothing to worry about.
Postscript: I still took a look at Google's logo. It uses the img mentioned in the first point of this article. And I see that some Wikipedias use css images, and their weight rankings don’t seem to have any impact! well! It’s a difficult question to determine, so let’s leave it to everyone! !
Source of this article: www.bobaiyou5.com
Thanks to Bobaiyou for your contribution