473,383 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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
Sep 23 '08 #1
14 1659
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/

Sep 23 '08 #2
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
Sep 23 '08 #3
On Sep 23, 5:22*pm, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
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
Sep 23 '08 #4
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/

Sep 23 '08 #5
On Sep 23, 7:39*pm, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
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
Sep 24 '08 #6
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.
Sep 24 '08 #7
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/

Sep 24 '08 #8
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?
Sep 24 '08 #9
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/

Sep 24 '08 #10
Jukka K. Korpela wrote:
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".
Then you don't understand anything I said and you don't understand
statistics.
Everyday experience is enough here, naturally assuming that your world
of experience contains so-called normal users.
Now you're *advocating* using gut feelings ("everyday experience",
which, for some reason, is better used unmeasured than measured or at
least sampled).
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.
You evidently don't understand statistics.
Sep 24 '08 #11
In article <Dy*******************@reader1.news.saunalahti.fi> ,
"Jukka K. Korpela" <jk******@cs.tut.fiwrote:
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.
So? If you were to employ a principle of charitable interpretation - not
your strong point, I know, - you would extend HM's point in a reasonable
rather than an unreasonable way to cover sites in general. The point is
this, if lots of stats were coming in for individual sites (say big well
known ones), and one made a rough average, then this rough average might
still be useful within a rough margin of error assessment. No, not
useless, useful. Useful. Enough for a rational person to think, "Hmm,
clearly better not ignore IE6's little peccadillos yet on this site I am
making; given that I see no special type of audience different to the
sorts that use the websites in the stats."

Look, the truth is not that you don't understand stats (as a justifiably
irritated HM said) but that you ... well.. you are just being you.

In As Good As It Gets, Helen Hunt, in exasperation says about Jack
Nicholson, who is one doozie of an awkward dude, that she wished he
would stop being himself for a moment.

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

please
don't use pseudostatistical terms like "margin of error".
It is hardly *this* in the context of this audience.

--
dorayme
Sep 24 '08 #12
On Sep 24, 11:48*pm, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article <DytCk.70808$_03.66...@reader1.news.saunalahti.fi> ,
*"Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
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 accessingthat
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.

So? If you were to employ a principle of charitable interpretation - not
your strong point, I know, - you would extend HM's point in a reasonable
rather than an unreasonable way to cover sites in general. The point is
this, if lots of stats were coming in for individual sites (say big well
known ones), and one made a rough average, then this rough average might
still be useful within a rough margin of error assessment. No, not
useless, useful. Useful. Enough for a rational person to think, "Hmm,
clearly better not ignore IE6's little peccadillos yet on this site I am
making; given that I see no special type of audience different to the
sorts that use the websites in the stats."

Look, the truth is not that you don't understand stats (as a justifiably
irritated HM said) but that you ... well.. you are just being you.

In As Good As It Gets, Helen Hunt, in exasperation says about Jack
Nicholson, who is one doozie of an awkward dude, that she wished he
would stop being himself for a moment.
So the
information is useful as long as one is aware of the margin of error
involved.
please
don't use pseudostatistical terms like "margin of error".

It is hardly *this* in the context of this audience.

--
dorayme
Maybe the best approach would be to use an analysis system as Google
Analytics on the web site and check over time what browsers and even
screen size are the users using and how the evolution is for that web
site and then update the web site over time according to it ...
Sep 24 '08 #13
In article
<6f**********************************@d1g2000hsg.g ooglegroups.com>,
shapper <md*****@gmail.comwrote:
Maybe the best approach would be to use an analysis system as Google
Analytics on the web site and check over time what browsers and even
screen size are the users using and how the evolution is for that web
site and then update the web site over time according to it ...
The best approach is to keep worrying about IE6 until it becomes obvious
that you should not. Never mind all this fine argy bargy.

Why would you need to update a website that satisfies IE6 if it already
satisfies other better browsers?

--
dorayme
Sep 25 '08 #14
On Sep 25, 1:21*am, dorayme <doraymeRidT...@optusnet.com.auwrote:
In article
<6f131dc4-3591-4511-80fc-f8968a749...@d1g2000hsg.googlegroups.com>,

*shapper <mdmo...@gmail.comwrote:
Maybe the best approach would be to use an analysis system as Google
Analytics on the web site and check over time what browsers and even
screen size are the users using and how the evolution is for that web
site and then update the web site over time according to it ...

The best approach is to keep worrying about IE6 until it becomes obvious
that you should not. Never mind all this fine argy bargy.

Why would you need to update a website that satisfies IE6 if it already
satisfies other better browsers?

--
dorayme
You have a point there ...

I am just saying that many times when I post a problem I get an
solution that does not work with IE6 and other that works.

Usually the one that does not work with IE6 seems much more logic and
easier to code ...

But I got it ...

Thanks,
Miguel
Sep 25 '08 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: vrillusions | last post by:
I've been using functions since I first started using php, but I've been hearing more and more about classes, which I never really looked at that much. I understand the whole OO programming...
4
by: Tuure Laurinolli | last post by:
Someone pasted the original version of the following code snippet on #python today. I started investigating why the new-style class didn't work as expected, and found that at least some instances...
1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
45
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes...
5
by: Bharat Karia | last post by:
Hi, Is it possible to writed Sealed classes in C++ . i.e. there is no sealed/final keyword in C++, but is it possible to achieve the same effect? i.e. deriving from a sealed class is an error...
4
by: john townsley | last post by:
do people prefer to design classes for the particular job or for a rangle of tasks they might encounter now and in the future. i am doing some simple win32 apps and picking classes is simple, but...
9
by: Gomaw Beoyr | last post by:
Two question about the "partial classes" (in the next wersion of ..NET). Question 1 ========== Will partial classes (in the next version of C#) have to be declared "partial" in ALL places. ...
11
by: C# Learner | last post by:
Is it not possible to declare a nested class in a seperate file from its "parent" class -- i.e. in a similar way to the idea of spreading namespaces over more than one file?
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
86
by: jopperdepopper | last post by:
Hi, finally giving php 5 a go, and going over the new approach to classes. Can someone clarify the public, private and protected to me? I quote the php manual: "The visibility of a property or...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.