Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Is there a way I can load a CSS stylesheet to a site I'm viewing in a browser?

I'm working on my company website. For obvious reasons I don't want to make changes to the live version of the site while I develop. Normally there is a development version I can work on, but this is currently down. All I need to do is add CSS and see these changes as I go along.

Firefox's web developer can add a local stylesheet, but as soon as you refresh the page or navigate away it stops being added and you have to manually add it again (even with persist features turned on). With all the incremental changes I need to make this isn't really a solution for me.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can put an alternate stylesheet into the header:

<LINK href="mystyle.css" title="Medium" rel="alternate stylesheet" type="text/css">

You can then select it from Firefox with View->Page Style->your stylesheet.

Anyone else viewing the page could do that, but I doubt they will think to do it. Presumably it's not a big problem if they do though.

This addon amongst other things lets you specify a local stylesheet if you can't change the live site. (I've not used it myself.)

share|improve this answer
    
Thanks for your solution. Ill bear it in mind for the future, but sadly it wont work for me. I cant get access to the web root of the live site at all, so I cant modify the live site in any way. –  user793011 Sep 22 '11 at 14:58
    
That's an interesting idea! Since Firefox 6, the option to change the page style is hidden, you have to press the <alt> key to temporary get the menu back. –  martinstoeckli Sep 22 '11 at 14:58
    
@user793011 I've updated my answer in the light of that comment. –  paulmorriss Sep 22 '11 at 15:16
    
Thanks again but sadly it has the same problem as the web developer add on, when you refresh or go to a new page the style sheet isn't loaded. –  user793011 Sep 22 '11 at 15:20

The Stylish Firefox add-on lets you manage a collection of local stylesheets that can be specified to work only for specific domains. Have a look at userstyles.org for what people have done with it.
There's also a version for Chrome, if needed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.