Closed Thread Icon

Preserved Topic: I don't want styles! (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=18073" title="Pages that link to Preserved Topic: I don&amp;#039;t want styles! (Page 1 of 1)" rel="nofollow" >Preserved Topic: I don&#039;t want styles! <span class="small">(Page 1 of 1)</span>\

 
lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 06-18-2001 15:04

I have defined stlyes in my program overwritting HTML tags, like for the "a" tag and "p" tag and "body" tag...

now, whenever i write the style get applied,

now how can i temporarily disabled all my defined styles and output using default styles,
and then enable the styles again?

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 06-18-2001 15:59

You should probably be linking to your stylesheet instead of embedding it:
<LINK href="/lib/lallous.css" rel="stylesheet" type="text/css">

Then you can just make the link change temporarily, and point it to an empty file.

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 06-18-2001 22:46

linear's suggestion is the best way but if you want a quick and dirty way, just comment out the style block like this:

<!--style type='text/css'>
body { font-family: verdana; font-size: 12px; }
.answer { font-family: verdana; font-size: 12px; font-weight: normal; color: #0000ff }
.rqdtext { font-family: verdana; font-size: 12px; font-weight: bold; color: #ff0000 }
.title { font-family: verdana; font-size: 18px; font-weight: bold; }
li { font-family: verdana; font-size: 12px; font-weight: normal; }
td { font-family: verdana; font-size: 12px; font-weight: normal; }
</style-->



bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-19-2001 06:04

If you mean in the middle of the page ie:
<your style>
<default style>
<your style>

then you will need to create default classes with default styles and use those.
you can't drop out of your css and go back (I'm pretty sure but I've been wrong before)

Also people can set their own browser defaults though most don't. You can't set back to these values.


Walking the Earth like Kane

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 06-19-2001 09:07

linear and bugimus...
I'm wanted to change/disable the style sheet effect during runtime actually,

like for examples events can be turned off for a while,

old_onload = onload;
onload = new function("return;");


Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-19-2001 20:05

Unfortunately, styles and HTML aren't dynamic, and don't really have a "run time". Either you're using styles, or you're not. There's no <dont use styles> </dont use styles> tag.

What you *can* do, however, is use classes to specify differences in styles throughout your page.

<style type="text/css">
P {color:red;}
P.regular {color:black;}
</style>

<p>this is a styled paragraph! It's red!</p>
<p class="regular">This paragraph is more regular.</p>
<p>This paragraph, however, is red again!</p>

See?
Unfortunately I'm not sure there's a way to use the *user's* default styles automatically. You just have to sort of specify what's generic... black, times new roman, 12 pt font.

linear
Paranoid (IV) Inmate

From: other places
Insane since: Mar 2001

posted posted 06-19-2001 20:52

"Unfortunately, styles and HTML aren't dynamic, and don't really have a "run time".

Well, you can change them after the document loads. I do it on my page, and here's the relevant stuff:

CSSbody = document.styleSheets[0].rules.item(0);
// my body rule is the zeroth rule in my zeroth stylesheet--make sure yours is, or change the numbers accordingly.
CSSbody.style.color = 'red'; // change the textcolor to red
CSSbody.style.backgroundColor = 'green'; // change the background to green

You could wrap those lines up in a function and call it at will.
(I suggest you name it eyestrain() if you use my colors....)

Edit: line breaks added for clarity



[This message has been edited by linear (edited 06-19-2001).]

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-19-2001 22:43

You'll notice I said "styles and HTML", not "JavaScript"! Heh =) JavaScript certainly makes a page dynamic, and you could say it has a "run time". But that doesn't really help with this particular situation... I don't think (although I may be wrong) that lallous was referring to anything happening *after* the page had loaded.

« BackwardsOnwards »

Show Forum Drop Down Menu