View Full Version : One stylesheet overriding the other
Sandstone-Shadow
07-10-2009, 11:58 PM
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.
Butterfree
07-11-2009, 12:30 AM
Use left:auto;
Sandstone-Shadow
07-11-2009, 12:47 AM
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?
Butterfree
07-11-2009, 02:29 AM
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.
Sandstone-Shadow
07-13-2009, 08:40 PM
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.
IIMarckus
07-14-2009, 03:54 AM
As long as I'm here, could anyone tell me what the difference between left:number; and margin-left:number; is?When in doubt, (http://www.w3.org/TR/CSS2/visuren.html#propdef-left) check the spec. (http://www.w3.org/TR/CSS2/box.html#propdef-margin-left)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?
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.