8

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?
Jesper Rønn-Jensen
  • 106,591
  • 44
  • 118
  • 155
  • You can look at the source of the web page and search where the css is located can't you – Joshua Partogi Oct 01 '09 at 08:15
  • 3
    @jpartogi: No, I'm searching the web for other references to the same code. The difference is that I am too lazy to manually view source on 20 billion web pages – Jesper Rønn-Jensen Oct 01 '09 at 13:58
  • I remember before I started designing my own sites, I used to buy premium templates. And (I don't remember _why_) tried searching for id names and element names that were unique to my site, on Google. And it showed up. A search for "JTVSearchQueryTextBox" returned a few of my website's pages that included that textbox on the page. I don't see why it's not working out for you. Maybe the terms you are using are too generic? Or maybe SE's just haven't indexed that information. – Arrow Aug 02 '12 at 15:45

4 Answers4

4

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
  • 106,591
  • 44
  • 118
  • 155
2

globalogiq.com/codesearch.htm

you have to login, the registration is free

MTVS
  • 2,046
  • 5
  • 26
  • 37
2

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
  • 3,382
  • 1
  • 21
  • 24
0

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
  • 21,728
  • 13
  • 62
  • 101