2014-01-14 29 views
1

我使用twitter bootstrap v 3,並且有一位學生要求我僅以黑白色顯示我的網站。如何將網站變成黑白

問:是否有快速關閉所有顏色的方法,或者是否需要覆蓋bootstrap-theme.css中的每種顏色?

也許我可以使用!important規則並覆蓋所有內容。

回答

0

可以使用*元素的樣式應用到頁面上的每一個元素,例如,使所有頁的黑色使用的字體:

* 
{ 
    color:black; 
} 
+0

但對於特異性? –

+0

哦!我可以完全關閉css! –

0

我會說把狀態周圍的CSS標籤:

if usr has defined they own css file, then 
use the users css file 
else 
use the default css file 
end if 
0

這可能不是你在尋找什麼,但是,如果你只需要在網站被「黑與白」是暫時的,你可以嘗試一個JavaScript書籤。如果存儲在書籤的形式這樣可以把任何網站爲灰度

javascript:(function(){ 
    document.body.setAttribute('style','filter:url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale");-webkit-filter:grayscale(1);filter:grayscale(1);'); 
})(); 

例如,改變你的網站爲灰度,而不會影響該網站本身,你可以試試這個。

要返回到原來的方式使用:

javascript:(function(){document.body.setAttribute('style','');})();