Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get css files from website?

I'm trying to get the content of css files of a website....

 <link href="/files/includes/templates-css-main.css" rel="stylesheet" type="text/css" />

For example, it's the link of css ref of http://paceoil.ca/. When I tried to send a request for getting a css file to this url http://paceoil.ca/files/includes/templates-css-main.css, I got an unexpected result.

Any help? Thanks in advance.

like image 426
Hrant Vardanyan Avatar asked Jan 10 '23 21:01

Hrant Vardanyan


2 Answers

On the particular website in question, the reason you're not seeing what you expected is because they've used an uncommon technique called @import to load several stylesheets into one. In general, your method is correct -- http://paceoil.ca/files/includes/templates-css-main.css is indeed a link to their stylesheet.

Inside that stylesheet, you'll see the following statements:

@import 'templates-css-reset.css';
@import 'templates-css-layout.css';
@import 'templates-css-type.css';
@import 'templates-css-nav.css';
@import 'modules-mod_superfishmenu-tmpl-css-superfish.css';

These lines simply load the contents of other .css files all together. The other CSS files can be found at:

  • http://paceoil.ca/files/includes/templates-css-reset.css
  • http://paceoil.ca/files/includes/templates-css-layout.css
  • http://paceoil.ca/files/includes/templates-css-type.css
  • http://paceoil.ca/files/includes/templates-css-nav.css
  • http://paceoil.ca/files/includes/modules-mod_superfishmenu-tmpl-css-superfish.css

It should also be noted that on some websites (most commonly on huge websites like facebook), CSS files are not necessarily statically generated. Some servers run "CSS-preprocessing" which allows them to embed code in CSS that is executed and translated before your browser ever sees it. In cases like this, it is impossible to view that code unless the owner shares it with you.

like image 143
Woodrow Barlow Avatar answered Jan 22 '23 01:01

Woodrow Barlow


press F12, resources. then you should see the css file of a site

like image 33
Bramos Avatar answered Jan 21 '23 23:01

Bramos