I have written an article HTML Image Tag for the site and it has been indexed by Google. But when I search it, google displays

HTML Image Tag - ProgrammingBulls


content { font-family:verdana; font-size:14px; font-weight:normal }

We often use images in a webpage. To insert images in our webpage < img> tag is used in.

Why is CSS displayed in the google search? I know that CSS and HTML is ignored by Google but due to some reason HTML is being displayed.


The "CSS" is actually text in the explicit description of the page:

<meta name="description" content=".content { font-family:verdana; font-size:14px; font-weight:normal } We often use images in a webpage.To insert images in our webpage &lt; img&gt; tag is used in HTML. HTML&lt; Img&gt;tag And Src Attribute Images are inserted into our HTML docs using the" />

… which Google often uses instead of trying to extract an automatic description from the page content.


David is correct, the CSS code is actually in the meta description. The reason for this is most likely your CMS is generating the meta description based on the first 255 characters of the article.

The first paragraph (inside div.content.pageview) contains that CSS. To fix this you should either move that CSS to your stylesheet, or put the style block at the bottom of the article instead of the top.

However, if you are only auto-generating the description based on the content of the article, I would suggest removing it entirely - or better yet write your own unique description for every page. This tag does not really help the ranking, especially when it just duplicates content already on the page.

Your Answer

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