![]() |
|
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: |
![]() |
|
|||
|
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 |
| Sponsored Links |
|
|||
|
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/ |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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/ |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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/ |
|
|||
|
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? |
|
|||
|
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/ |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
- Contact Us
-|-
CSS & Stylesheet Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise