Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

http://programmingbulls.com/html-image-tag-1:

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.

share|improve this question
add comment

migrated from stackoverflow.com Jul 19 '11 at 10:27

This question came from our site for professional and enthusiast programmers.

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.