• Welcome to The Cave of Dragonflies forums, where the smallest bugs live alongside the strongest dragons.

    Guests are not able to post messages or even read certain areas of the forums. Now, that's boring, don't you think? Registration, on the other hand, is simple, completely free of charge, and does not require you to give out any personal information at all. As soon as you register, you can take part in some of the happy fun things at the forums such as posting messages, voting in polls, sending private messages to people and being told that this is where we drink tea and eat cod.

    Of course I'm not forcing you to do anything if you don't want to, but seriously, what have you got to lose? Five seconds of your life?

One stylesheet overriding the other

Sandstone-Shadow

A chickadee in love with the sky
Pronoun
she/her
So, I'm working on an alternate stylesheet... My default stylesheet contains the code left:25px;. The alternate one does not, because the menu is all the way to the right, so I can't define how far from the left it is. However, the default stylesheet applies that code anyway, since left:; doesn't show up in the alternate one.

I'm using a javascript styleswitcher. Is my only (or best) alternative to switch to a PHP styleswitcher, or is there something that I can enter into left:; to cancel out the effects of the default stylesheet without actually defining the distance from the left?

...Hopefully that all makes sense. ^^; Let me know if it doesn't, and I'll try to rephrase it.
 
Ah, thank you! ^^

As long as I'm here, could anyone tell me what the difference between left:number; and margin-left:number; is? I've been using them both and sometimes one will change something while the other doesn't, and I've never really been able to figure out the difference although maybe that's something I should look up on my own instead of asking xD;

Edit: And one more question: is it possible to set something's width so that it is, for instance, 300 pixels smaller than 100% of the screen width?
 
Last edited:
As long as I'm here, could anyone tell me what the difference between left:number; and margin-left:number; is? I've been using them both and sometimes one will change something while the other doesn't, and I've never really been able to figure out the difference although maybe that's something I should look up on my own instead of asking xD;
There's little functional difference between them, really, but you can use margin-left without giving the element a position, and they can be used independently of one another to mix two kinds of units. I can't remember much else in the way of practical differences off the top of my head.

Edit: And one more question: is it possible to set something's width so that it is, for instance, 300 pixels smaller than 100% of the screen width?
No. Which is a shame, because that would be very useful.
 
There's little functional difference between them, really, but you can use margin-left without giving the element a position, and they can be used independently of one another to mix two kinds of units. I can't remember much else in the way of practical differences off the top of my head.
Mmkay, thanks. ^^

No. Which is a shame, because that would be very useful.
Darn. =/ Though I found a way to get by it for my purposes; I wanted the content to fit on the left side of the screen without overlapping the banner (which is going to be on the right), so I set the right margin to the width of the banner.
 
As long as I'm here, could anyone tell me what the difference between left:number; and margin-left:number; is?
When in doubt, check the spec.
And one more question: is it possible to set something's width so that it is, for instance, 300 pixels smaller than 100% of the screen width?
No. Which is a shame, because that would be very useful.
I don’t mess with CSS all that much, but couldn’t you put something in a 100%‐width 300px‐padded div?
 
Back
Top Bottom