user3094394 user3094394 - 10 months ago 38
CSS Question

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 When I tried to send a request for getting a css file to this url, I got an unexpected result.

Any help? Thanks in advance.

Answer Source

On the particular website in question, the reason you're not seeing what you expected is because they've used an uncommon @import to load several stylesheets into one. In general, your method is correct -- 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:

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.