PDA

View Full Version : Inline cascading?



Ultragames
Aug 29th, 2007, 08:53 PM
Is there any way to do something like this>

<table style="this td{ border: none; }"></table>

I know that in a style sheet or styel tag, you can do this:

<style>
table {
border: 1px solid #ff00ff;
}
table td {
border: 1px solid #00ff00;
}
</style>

However what I am looking for is a way to control on elements children or a certain type using inline styles. If that makes any sense at all...

rmedek
Aug 29th, 2007, 10:23 PM
No…an inline style is just that—inline. The cascade is used in style sheets (or styles written in the <head>) only.

You'd have to use the rule on each <td> within the table. But why do this when it's just as simple to define the styles externally or even in the <head>?

Ultragames
Aug 29th, 2007, 10:30 PM
I think this is a feature that should be added. Additionaly I think that backward cascading should be possible. For instance that if I have class A, and it has a border. Well if I put something with Class B inside of it, I would like to make class B turn off class A's border. I guess CSS just can't be that easy.

rmedek
Aug 29th, 2007, 10:44 PM
I think this is a feature that should be added. Additionaly I think that backward cascading should be possible. For instance that if I have class A, and it has a border. Well if I put something with Class B inside of it, I would like to make class B turn off class A's border. I guess CSS just can't be that easy.

Yes. The way you describe it sounds much easier than it is now. :rolleyes: