Web Hosting CSS & Stylesheet Forums

Add Me

User Name
Password
Go Back   CSS & Stylesheet Forums > CSS Forumz: Main > Style Sheet In General

Welcome to the CSS & Stylesheet Forums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags:



Reply
  #1 (permalink)  
Old 09-24-2008, 05:53 AM
shapper
Guest
 
Posts: n/a
Diggs:
Default Two CSS Classes. Is this possible?



Hello,

Is it possible to apply a style to a div that has exactly two CSS
Classes?

<div class="A B">Test 1</div>

<div class="A">Test 2</div>

I want to change the background color of the first div because it has
classes A and B applied.

I need to be able to create like a composite class ... I think this is
not possible. Just checking.

Thanks,
Miguel
Reply With Quote


Sponsored Links
  #2 (permalink)  
Old 09-24-2008, 05:54 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

shapper wrote:

> Is it possible to apply a style to a div that has exactly two CSS
> Classes?


Of course.

> <div class="A B">Test 1</div>
>
> <div class="A">Test 2</div>
>
> I want to change the background color of the first div because it has
> classes A and B applied.


What's the problem? You can use either the selector .A or the selector .B,
or even the selector div - or the selector *, to take things into the
extreme.

> I need to be able to create like a composite class ... I think this is
> not possible. Just checking.


I think you are not really describing the problem. I guess you mean that the
CSS rules should _only_ apply to a div that has both classes.

For this, you would just the selector

div.A.B

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote


  #3 (permalink)  
Old 09-24-2008, 05:54 AM
Joshua Cranmer
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

shapper wrote:
> Hello,
>
> Is it possible to apply a style to a div that has exactly two CSS
> Classes?
>
> <div class="A B">Test 1</div>
>
> <div class="A">Test 2</div>
>
> I want to change the background color of the first div because it has
> classes A and B applied.


..A.B will style all elements with both classes A and B, but this does
not work on IE 6.0 (although it does on IE 7+).

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Reply With Quote


  #4 (permalink)  
Old 09-24-2008, 05:54 AM
shapper
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

On Sep 23, 5:22-pm, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:
> shapper wrote:
> > Is it possible to apply a style to a div that has exactly two CSS
> > Classes?

>
> Of course.
>
> > <div class="A B">Test 1</div>

>
> > <div class="A">Test 2</div>

>
> > I want to change the background color of the first div because it has
> > classes A and B applied.

>
> What's the problem? You can use either the selector .A or the selector .B,
> or even the selector div - or the selector *, to take things into the
> extreme.
>
> > I need to be able to create like a composite class ... I think this is
> > not possible. Just checking.

>
> I think you are not really describing the problem. I guess you mean that the
> CSS rules should _only_ apply to a div that has both classes.
>
> For this, you would just the selector
>
> div.A.B
>
> --
> Yucca,http://www.cs.tut.fi/~jkorpela/


Hi,

Yes I meant div.A.B ...

I didn't know how to explain it.

As usual, it does not work in IE 6 ... Does anyone has some statistics
for how IE 6 is still used?

Do you still care about IE6 or not? Just wondering ...

Thanks,
Miguel
Reply With Quote


  #5 (permalink)  
Old 09-24-2008, 05:54 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

shapper wrote:

> As usual, it does not work in IE 6 ...


So what? You remember the usual CSS caveats, don't you?

> Does anyone has some statistics
> for how IE 6 is still used?


Lies, blatant lies, statistics, Internet statistics - do you really want to
go that way?

> Do you still care about IE6 or not?


You haven't told which kind of optional presentational suggestions (which is
all you can say in CSS) you are trying to make, so how could _we_ decide
whether it matters that the most common (?) browser ignores them? And you
haven't explained why you would need to use a two-class selector instead of
something more robust.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote


  #6 (permalink)  
Old 09-24-2008, 05:54 AM
shapper
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

On Sep 23, 7:39-pm, "Jukka K. Korpela" <jkorp...@cs.tut.fi> wrote:
> shapper wrote:
> > As usual, it does not work in IE 6 ...

>
> So what? You remember the usual CSS caveats, don't you?
>
> > Does anyone has some statistics
> > for how IE 6 is still used?

>
> Lies, blatant lies, statistics, Internet statistics - do you really want to
> go that way?
>
> > Do you still care about IE6 or not?

>
> You haven't told which kind of optional presentational suggestions (whichis
> all you can say in CSS) you are trying to make, so how could _we_ decide
> whether it matters that the most common (?) browser ignores them? And you
> haven't explained why you would need to use a two-class selector instead of
> something more robust.
>
> --
> Yucca,http://www.cs.tut.fi/~jkorpela/


I don't need but it would make my CSS shorter because I would use less
classes in my code ...

As I said, I was just wondering if this was possible ... it would be
good in some cases.

I am developing following W3C rules and I don't ignore IE6 ...

But I suppose there will be one day when IE6 will be not commonly
used. I hope the day is not that far :-)

Thank You,
Miguel
Reply With Quote


  #7 (permalink)  
Old 09-29-2008, 12:41 AM
Harlan Messinger
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

Jukka K. Korpela wrote:
> shapper wrote:
>
>> As usual, it does not work in IE 6 ...

>
> So what? You remember the usual CSS caveats, don't you?
>
>> Does anyone has some statistics
>> for how IE 6 is still used?

>
> Lies, blatant lies, statistics, Internet statistics - do you really want
> to go that way?


If, for example, the statistics for a government website that receives
over 40,000 visits a day show that 28% of the requests from IE are
currently from IE6 (as is the case), the actual usage may be 35% or 25%
or 20% but it's really unlikely that it's 5% or 1%. So the information
is useful as long as one is aware of the margin of error involved.

Having said that, a new Sharepoint-based application was showing that
90%+ of its hits were coming from IE4. It turned out that the
application's own content indexer was being identified as IE4.
Reply With Quote


  #8 (permalink)  
Old 09-29-2008, 12:41 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

Harlan Messinger wrote:

>> Lies, blatant lies, statistics, Internet statistics - do you really
>> want to go that way?

>
> If, for example, the statistics for a government website that receives
> over 40,000 visits a day show that 28% of the requests from IE are
> currently from IE6 (as is the case), the actual usage may be 35% or
> 25% or 20%


Or something else. Moreover, which "actual usage"? Usage when accessing that
site, or web access in general? One site's statistics, even if it were
meaningful in its own context, says nothing about another site's usage.

By the way, according to most statistics I've seen, IE 6 is still more
common than IE 7, or about equally common. Anything older than IE 6 is
almost ignorable by now, which is of course good news to authors.

> So the
> information is useful as long as one is aware of the margin of error
> involved.


Which margin of error? You don't know it. You _might_ have a reasonable
good estimate of the margin error for a _site_ (that is, you might be able
to say that with reasonable probability, visits to a particular site are
made with, say, IE 6 in 40 - 60 % of cases. But regarding web usage in
general, what would you base the estimates on? Gut feeling? Then please
don't use pseudostatistical terms like "margin of error".

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote


  #9 (permalink)  
Old 09-29-2008, 12:41 AM
Harlan Messinger
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

Jukka K. Korpela wrote:
> Harlan Messinger wrote:
>
>>> Lies, blatant lies, statistics, Internet statistics - do you really
>>> want to go that way?

>>
>> If, for example, the statistics for a government website that receives
>> over 40,000 visits a day show that 28% of the requests from IE are
>> currently from IE6 (as is the case), the actual usage may be 35% or
>> 25% or 20%

>
> Or something else. Moreover, which "actual usage"? Usage when accessing
> that site, or web access in general? One site's statistics, even if it
> were meaningful in its own context, says nothing about another site's
> usage.
>
> By the way, according to most statistics I've seen, IE 6 is still more
> common than IE 7, or about equally common. Anything older than IE 6 is
> almost ignorable by now, which is of course good news to authors.
>
>> So the
>> information is useful as long as one is aware of the margin of error
>> involved.

>
> Which margin of error? You don't know it. You _might_ have a reasonable
> good estimate of the margin error for a _site_ (that is, you might be
> able to say that with reasonable probability, visits to a particular
> site are made with, say, IE 6 in 40 - 60 % of cases. But regarding web
> usage in general, what would you base the estimates on? Gut feeling?
> Then please don't use pseudostatistical terms like "margin of error".


Absent any particular reason to think that the millions of otherwise
diverse people with IE6 have substantially different browsing habits
from the millions of otherwise diverse people with IE7, it's a
reasonably good estimate for the population at large. That isn't a gut
feeling, it's a statistically sound observation. And so I chose to use a
pedestrian term instead of "confidence interval" or "standard error".
Got anything else pointless to pick on while you're at it? Would you
like to challenge me on degrees of freedom and Bayesian analysis while
you're at it?
Reply With Quote


  #10 (permalink)  
Old 09-29-2008, 12:41 AM
Jukka K. Korpela
Guest
 
Posts: n/a
Diggs:
Default Re: Two CSS Classes. Is this possible?

Harlan Messinger wrote:

[excessive quotation, always a useful indicator]

> Absent any particular reason to think that the millions of otherwise
> diverse people with IE6 have substantially different browsing habits
> from the millions of otherwise diverse people with IE7, it's a
> reasonably good estimate


You verbosely try to put the burden of proof on anyone who asks what you
base your statements on.

> That isn't a gut
> feeling, it's a statistically sound observation.


You haven't expressed anything statistical. Just some babbling followed by a
claim on being "statistically sound".

Everyday experience is enough here, naturally assuming that your world of
experience contains so-called normal users.

We don't _need_ any statistics for deciding that we still have IE 6 users
with us. Still less we need off-topic pseudo-statistics.

--
Yucca, http://www.cs.tut.fi/~jkorpela/

Reply With Quote


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 10:13 PM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.




Inactive Reminders By Mished.co.uk