Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Sub styles

0 views
Skip to first unread message

Bob Phillips

unread,
Sep 5, 2001, 2:19:38 PM9/5/01
to
Hi,

I am wondering if this is do-able.

I would like to setup a table style called 'table1' say, and then create
extra properties for just the TD items within that table. For instance, I
would set the table background colour to red, but have the TD items with a
background colour of blue (TH would still be red, inheriting the TABLE
property).

I could define a TD style, but that would affect all TDs, not just those in
a 'table1' TABLE.

I could define a new style and assign to each TD, but I was hoping for
something classier than that.

I am thinking something along the lines of :
.table1 {
background-color: red
}
.table1.TD {
background-color: blue
}
but that doesn't work in that format.

Any smart ideas out there?

TIA

Bob

PS What is the difference between a style called '.table1' and one called
'#table1'?


Manish

unread,
Sep 5, 2001, 2:40:56 PM9/5/01
to

"Bob Phillips" <bob.ph...@freeuk.com> wrote in message
news:#im#UajNBHA.464@tkmsftngp03...

>
> I could define a new style and assign to each TD, but I was hoping for
> something classier than that.
>
> I am thinking something along the lines of :
> .table1 {
> background-color: red
> }
> .table1.TD {
> background-color: blue
> }
> but that doesn't work in that format.

try -

.table1 {background-color: red;}
.table1 td {background-color: blue;}

works well in my IE 5.5.

>
> Any smart ideas out there?

> PS What is the difference between a style called '.table1' and one called
> '#table1'?

AFAIK, when you use .table1 use use it in class of the element and when you
use #table1 you'll put it in an ID of the element.

HTH,
- Manish
http://www.technofundo.com/

Bob Phillips

unread,
Sep 5, 2001, 2:45:22 PM9/5/01
to

Thanks Manish. Works well in my IE 5 as well.

Bob

Manish <m...@gmx.DeleteThis.co.uk> wrote in message
news:uquTYljNBHA.1292@tkmsftngp03...

John PJ Perry

unread,
Sep 5, 2001, 4:34:40 PM9/5/01
to
Or,

<STYLE>
BODY
{
}
BODY #MyTable
{
BACKGROUND-COLOR: red
}
BODY #MyTable TD
{
BACKGROUND-COLOR: blue
}
</STYLE>

If you're using ID's - but this will limit you if you need this applied to
multiple objects, the class example will probably be a better solution.

--------------------
* From: "Manish" <m...@gmx.DeleteThis.co.uk>
* References: <#im#UajNBHA.464@tkmsftngp03>
* Subject: Re: Sub styles
* Date: Thu, 6 Sep 2001 00:10:56 +0530
* Lines: 38
* X-Priority: 3
* X-MSMail-Priority: Normal
* X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
* X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
* Message-ID: <uquTYljNBHA.1292@tkmsftngp03>
* Newsgroups:
microsoft.public.windows.inetexplorer.ie55.programming.css
* NNTP-Posting-Host: 202.71.141.51
* Path: cppssbbsa01.microsoft.com!tkmsftngp01!tkmsftngp03
* Xref: cppssbbsa01.microsoft.com
microsoft.public.windows.inetexplorer.ie55.programming.css:1056
* X-Tomcat-NG:
microsoft.public.windows.inetexplorer.ie55.programming.css
*
*
* "Bob Phillips" <bob.ph...@freeuk.com> wrote in message
* news:#im#UajNBHA.464@tkmsftngp03...
* >
* > I could define a new style and assign to each TD, but I was
hoping for
* > something classier than that.
* >
* > I am thinking something along the lines of :
* > .table1 {
* > background-color: red
* > }
* > .table1.TD {
* > background-color: blue
* > }
* > but that doesn't work in that format.
*
* try -
*
* .table1 {background-color: red;}
* .table1 td {background-color: blue;}
*
* works well in my IE 5.5.
*
* >
* > Any smart ideas out there?
*
* > PS What is the difference between a style called '.table1' and
one called
* > '#table1'?
*
* AFAIK, when you use .table1 use use it in class of the element and
when you
* use #table1 you'll put it in an ID of the element.
*
* HTH,
* - Manish
* http://www.technofundo.com/
*
*
*
*

----

John PJ Perry
Support Engineer
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
You assume all risk for your use. © 2001 Microsoft Corporation. All rights
reserved.

bob

unread,
Sep 9, 2001, 6:12:40 PM9/9/01
to
#blah refers to places that are named blah.
i.e. --> <a name="blah">woot</a> would be part of that

.hisexy is a class
i.e. --> <table class="hisexy"...

that would be the 'PS' thing. ;]


"Bob Phillips" <bob.ph...@freeuk.com> wrote in message

news:#im#UajNBHA.464@tkmsftngp03...

0 new messages