views:

57

answers:

3

I wanted to find the origin page of a CSS file that somebody once included in a project I'm working on. Unfortunately, the guy that included it didn't write where from it came and has only a vague memory that 'somebody' sent the source file to him.

I wanted to search the web for pages with this css rule #loginNemId .inner { ... }

but nothing showed up on a google search for #loginNemId. Same reult when searching for id="loginNemId" as part of the page's source code. For completeness sake, I also searched for an included background image "bgLoginNemId.png", but that was also unsuccessful.

I really would like to know:

  • what is the best way to search for text in HTML files source code?
  • is there a way to search for content in CSS files or blocks within the HTML?
+1  A: 

Have you tried http://www.google.com/codesearch ?

Unfortunately for you, mainstream search engines go to a lot of effort to remove all that html/css/javascript gubbins as they want their search results to be based on what a normal user sees.

wefwfwefwe
I wasn't aware of codesearch.thanks for pointing me to it. But unfortunately, it does not return any results for #loginNemId or similar
Jesper Rønn-Jensen
I suspect that unless there's any other distinctive user-visible text in the component then your SOL.
wefwfwefwe
A: 

Although google does index CSS files it only does this to check that content on the page is not being hidden for spamming purposes. It does not include the contents of the CSS file in the searchable results for websites.

Richard
A: 

To sum up the other answers, it seems there is currently no way to search for text in HTML source code.

There is one exception ot this rule: if the code you search for is open-source and indexed by Google Code Search.

Jesper Rønn-Jensen