3

I am attempting to locate some CSS rules but they do not exist in the index.php header tag, nor in the only CSS file which the header references.

Where else could they be?

3 Answers3

5

CSS can be located directly in your HTML files within the <head> tag wrapped in <style> tags. You can also style elements inline such as <div style="width:100px;"></div>

CSS files can import other CSS files via @import. It is also possible that styles are changed or added with Javascript.

Anagio
  • 11,195
  • 1
  • 26
  • 49
  • Thanks, there is no CSS within the head tag. There is an external stylesheet, which is referenced in the head tag. But it does not contain a boatload of CSS which the site employs, but I cannot find. –  Mar 19 '12 at 18:35
  • Have you checked for CSS in inline style elements? – Adjam Mar 19 '12 at 18:39
  • CSS files can also be imported using the @import function within .css files. It's also possibly that inline styles are set using javascript but the majority of the styles would not have this – Anagio Mar 19 '12 at 18:41
  • No inline styles and no @import –  Mar 19 '12 at 18:49
  • some inline for minor JS but otherwise I just can't find a lot of CSS. I must be missing something obvious –  Mar 19 '12 at 18:50
  • I have located it. It was in a PHP file. I am very new to all this, thank you so much for your advice! –  Mar 19 '12 at 18:58
  • @ChrisHayward If you use a decent browser you can simply inspect the DOM and find out where all (computed) styles are coming from. – PeeHaa Mar 19 '12 at 21:50
  • @PeeHaa Hey thanks, I use Safari's Developer tools however as far as I can tell it doesn't show me where the computed styles are coming from. I can edit them for preview in the browser, but it does not show where they actually exist (in what file). If they do I don't know where that feature is in the dev tools. Do you? –  Mar 20 '12 at 01:00
  • @ChrisHayward The file in which the styles can be found are under styles or if they are inline styles they are under element.style(). – PeeHaa Mar 20 '12 at 08:55
2

CSS Rules can also be assigned through JavaScript/jQuery.

mvark
  • 3,067
  • 13
  • 20
1

You can import a stylesheet directly through .htaccess, but the is only supported by Firefox and Opera at the moment.

ditto
  • 111
  • 2