Page 1 of 1

Quick Question about css selectors

Posted: Wed Aug 08, 2007 7:07 pm
by smudge
Ok, I've looked around and can't seem to find the answer.
In CSS, how do you select the inverse of td#body p.indent ?
In other words, how do you select everything BUT paragraphs with the class indent?

And while I'm at it, how do you get a table to extend to the bottom of the screen?
height:100% doesn't seem to work, or at least in all situations.

Re: Quick Question about css selectors

Posted: Wed Aug 08, 2007 8:21 pm
by superdezign
smudge wrote:Ok, I've looked around and can't seem to find the answer.
In CSS, how do you select the inverse of td#body p.indent ?
In other words, how do you select everything BUT paragraphs with the class indent?
You can't. The 'C' in CSS is 'cascading,' and the entire concept is based on inheritance. You could define the other styles, and the redefine the one you don't want to change to look like it did before.

Code: Select all

.class * {
/* Styles for everything else */
}

.class p.indent {
/* Styles for this particular element */
}
smudge wrote:And while I'm at it, how do you get a table to extend to the bottom of the screen?
height:100% doesn't seem to work, or at least in all situations.
Percentages only work when the containing element has a set size.

Posted: Wed Aug 08, 2007 8:49 pm
by smudge
Yeah, I had a major duh moment half an hour after I posted when I realized that, and already fixed it, but wanted to leave the question standing just in case :D
As for the table, I've done sites before where I can get a row in a table to hug the bottom of the screen, but when I went back to check, I couldn't see how I did it.

Re: Quick Question about css selectors

Posted: Wed Aug 08, 2007 9:42 pm
by superdezign
superdezign wrote:Percentages only work when the containing element has a set size.
Have you tried sizing the HTML and BODY elements? Maybe try a height:100% on both and see what you get.

Posted: Wed Aug 08, 2007 10:14 pm
by iknownothing
smudge wrote: As for the table, I've done sites before where I can get a row in a table to hug the bottom of the screen, but when I went back to check, I couldn't see how I did it.
Heres something that will do it, Pity about IE6 but...

Code: Select all

position: fixed; // IF you want it to never move
bottom:0px; //On the bottom, obviously...