# Darken The Background Of Any Web Page For Readability



## Zri (Jul 9, 2006)

I am not sure whether you all have this problem or not, but I sometimes find reading long web articles, such as the articles in Wikipedia, very difficult due to the glare from the computer monitor. My eyes will start to feel fatigued if I read web articles for long periods of time. I would normally lower the brightness to make it easier for me to read, but then most of the time I would want to only read one or two articles. Besides that, lowering the brightness will negatively affect the pictures in the article.

I then found a 'hack' that would invert all the colours in the web page. The black coloured fonts will be turned to white or grey, while the white background will be changed to a black background. Images in the web page will not be affected by the 'hack'. Just bookmark the following link:


```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20white%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
When you click on the link in your bookmarks or favorites, the web page's colour will be inverted! This 'hack' is very useful by reducing the glare from the monitor in order to help you to read web articles easier! This 'hack' works for Firefox, Internet Explorer and Opera. The web page can be changed back to its original state by simply refreshing the page. I hope that you will find this 'hack' useful!

Here are modified versions of the 'hack' to suit your taste! Just bookmark the link and then click on the link in your favorites/bookmarks:

*Blue*

```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20blue%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
*Red*

```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20red%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
*Yellow*

```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20yellow%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
*Gold*

```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20gold%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
*Green*

```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20green%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
*Lime*

```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20black%20!%20important;%20color:%20lightgreen%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
*Blue Background, White Font.*

```
javascript:(function(){var%20newSS,%20styles='*%20{%20background:%20darkblue%20!%20important;%20color:%20white%20!important%20}%20:link,%20:link%20*%20{%20color:%20#0000EE%20!important%20}%20:visited,%20:visited%20*%20{%20color:%20#551A8B%20!important%20}';%20if(document.createStyleSheet)%20{%20document.createStyleSheet("javascript:'"+styles+"'");%20}%20else%20{%20newSS=document.createElement('link');%20newSS.rel='stylesheet';%20newSS.href='data:text/css,'+escape(styles);%20document.getElementsByTagName("head")[0].appendChild(newSS);%20}%20})();
```
Original article:
http://lifehacker.com/software/life...colors-with-the-darken-bookmarklet-259456.php


----------



## YellerPuma (Mar 8, 2008)

I like that Thanks!


----------



## AleciaBrent (Aug 21, 2008)

That's good one, thanks for it.


----------



## guitar (Jan 15, 2006)

you can change it in firefox tools/options/content/colours 
i also deselect use system colours and deselect allow pages to choose their own colours
i use white text on black background with adblock i get no bright things i dont want plus flashblock and in the dark as my theme
a lot better on the eyes


----------



## buffoon (Jul 16, 2008)

Phew! And I thought I was going blind. Thanks a lot, that's brilliant (I mean, on the contray, of course). Glad to find I'm not the only one whose eyes get tired.


----------



## Tomtatomtom (May 29, 2008)

I like it. Easy on the eyes. Might sop getting headaches.


----------



## Zri (Jul 9, 2006)

You are all welcome!  I am glad to know that my thread has helped many people!


----------

