Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How could I "turn off" a stylesheet?

I am creating a website for a University assignment and we have to concentrate on the accessability functions. I have successfully managed to use resize text buttons but am looking for a way to turn off a css file via a button or link.

I have scoured the net and cannot seem to find very much, I found a good website that had the button I am looking for so hit F12 but it would not display the javascript for it.

Ideally I would like to achieve it without the use of javascript but if there is no other way then I am open to any help that I can get.

I am sorry if this is a simple question but I really did look hard for an answer but to no avail, I am only a first year student so have a long way to go!

like image 533
Phil Avatar asked Mar 11 '11 20:03

Phil


People also ask

How do I disable stylesheet?

Select the "CSS" option in the Web Developer extension and click "Disable All Styles," or click the "Style Sheets" option in Pendule and click "Disable All Styles." After you click the option, the page will re-display without the styles.

How do I turn off styles in safari?

Safari: Safari > Preferences... > Show Develop menu in menu bar . Then go to the Develop dropdown and select the “Disable Styles” option.

How do you edit a style sheet?

You can edit or remove a stylesheet that's already attached by hovering over it and clicking Edit to make changes to it or the X to remove it. After adding a stylesheet, click Publish changes in the upper right-hand corner to apply your changes to the live pages(s) using the template.

How do I enable style sheets?

Select "Preferences..." under the Edit menu. Once the Preferences dialog comes up, select the "Web Content" section (under "Web Browser"). Make sure that "Show Style Sheets," "Allow page to specify colors," and "Allow page to specify fonts" are all checked.


1 Answers

This should work

for ( i=0; i<document.styleSheets.length; i++) {
    void(document.styleSheets.item(i).disabled=true);
}
like image 192
John Giotta Avatar answered Oct 21 '22 23:10

John Giotta