I am no CSS guru so please help!
I have a web page which includes a table. Inside one cell is a span in
which content from a database will be inserted. The span has a CSS class of
"databasecontent".
I now want to have my .css file containing a set of declarations that work
only for this area and do not affect other areas of the page.
I was thinking I could do something like:
table.databasecontent
{
border-width: 1px;
}
...to adjust tables only in the span. This doesn't work for me though.
Can anybody give a suggestion please? It has to work from a CSS class as it
is a part of a .NET web user control so the ID tag is not an option (it
changes from page to page automatically).
Thanks in advance.
RDC
> I have a web page which includes a table. Inside one cell is a span
in
> which content from a database will be inserted. The span has a CSS
class of
> "databasecontent".
>
> I now want to have my .css file containing a set of declarations that
work
> only for this area and do not affect other areas of the page.
You want style a table based on its content - I don't believe this
can be done.
As far as I know, everything in CSS starts at some top-level element
and filters down, thus, starting at a contained span won't allow you to
rise back to it's container table, unfortunately
Also, I don't know of any CSS workaround - though it could be done
using javascript
> I was thinking I could do something like:
>
> table.databasecontent
> {
> border-width: 1px;
> }
This will affect any table with the class 'databasecontent' only
<table class="databasecontent"></table>
> Can anybody give a suggestion please? It has to work from a CSS
class as it
> is a part of a .NET web user control so the ID tag is not an option
(it
> changes from page to page automatically).
>
> Thanks in advance.
>
> RDC
Sorry; can't be more help, but if you would like me to do up some
javascript (which I cannot guarantee its level of compatibility),
and/or give you a brief overview of the workings of the CSS selectors I
know, then I'll be happy to tell.
Regards,
MRe