This was interesting

Discussion in 'HTML' started by Lewis, Feb 2, 2011.

  1. Lewis

    Lewis Guest

    I was looking at some page source toady and I came across this:

    <div class="bar group">

    Pretty sure I've never seen that, so I did a little testing at it
    appears to apply both the .bar and .group styles to the div, but I have
    to wonder, WHY?

    Is this common? I'm trying to wrap my head around why you'd want to do
    this this way and I'm not coming up with a lot.

    ..red { color: red; }

    class="style1 red"

    is about the only thing I can think of where it seems like it might make
    sense (not that specifically, but that sort of thing).

    I did look, briefly, at the CSS and both bar and group were rather
    complicated, and shared a lot of the identical css settings, so I'm not
    sure what the point was.

    --
    IT'S BECAUSE OF THE UNCERTAINTY PRINCIPLE. 'What's that?' I'M NOT
    SURE. --The Fifth Elephant
    Lewis, Feb 2, 2011
    #1
    1. Advertising

  2. Multiple classes (Re: This was interesting)

    Lewis wrote:

    > I was looking at some page source toady and I came across this:
    >
    > <div class="bar group">
    >
    > Pretty sure I've never seen that,


    It's actually rather common to have multiple classes listed in a class
    attribute, especially since Netscape 4 (which didn't grok such constructs)
    virtually died.

    By the way, "This was interesting" was about the most uninteresting heading
    you can write. I wouldn't have looked at the message if they didn't pay me
    for reading alt.html. Oh wait... what are you saying? The _don't_ pay me?
    D'Oh!

    > so I did a little testing at it
    > appears to apply both the .bar and .group styles to the div, but I
    > have to wonder, WHY?


    Because that's what the specifications say.

    > Is this common?


    Rather common, especially when CSS is used in a relatively advanced way.

    > I'm trying to wrap my head around why you'd want to do
    > this this way and I'm not coming up with a lot.
    >
    > .red { color: red; }
    >
    > class="style1 red"


    Not along those lines for sure. To begin with, the name "style1" says
    virtually nothing, and "red" is worse because it easily gets misleading
    (when, say, someone decides to render warnings not in red but in some other
    prominent way). And without anything declared for "style1" anywhere, it's
    presence is pointless.

    For example, suppose that you have a table where some cells contain numeric
    data (and should therefore be right-aligned) and some cells are to be
    highlighted, you might have CSS rules like

    ..numeric { text-align: right; }
    ..highlight { background: #ffd; color: black; }

    And when you have a cell that contains numeric data _and_ should be
    highlighted... what would you do in HTML markup?

    Yes, you would use <td class="numeric highlight">42</td>.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Feb 2, 2011
    #2
    1. Advertising

  3. Lewis

    123Jim Guest

    "Lewis" <> wrote in message
    news:iibd2j$vt7$-september.org...
    >I was looking at some page source toady and I came across this:
    >
    > <div class="bar group">
    >
    > Pretty sure I've never seen that, so I did a little testing at it
    > appears to apply both the .bar and .group styles to the div, but I have
    > to wonder, WHY?
    >
    > Is this common? I'm trying to wrap my head around why you'd want to do
    > this this way and I'm not coming up with a lot.
    >
    > .red { color: red; }
    >
    > class="style1 red"
    >
    > is about the only thing I can think of where it seems like it might make
    > sense (not that specifically, but that sort of thing).
    >
    > I did look, briefly, at the CSS and both bar and group were rather
    > complicated, and shared a lot of the identical css settings, so I'm not
    > sure what the point was.
    >
    > --


    http://webdesign.about.com/od/css/qt/tipcssmulticlas.htm
    "One of the lesser known tricks with CSS is the fact that you don't have to
    limit your elements to just one class. If you need to set multiple classes
    on an element, you add them simply by separating them with a space in your
    attribute."

    I can see it being useful for something.
    123Jim, Feb 2, 2011
    #3
  4. On 02/02/11 10:53, Lewis wrote:
    > I was looking at some page source toady and I came across this:
    >
    > <div class="bar group">
    >
    > Pretty sure I've never seen that, so I did a little testing at it
    > appears to apply both the .bar and .group styles to the div, but I have
    > to wonder, WHY?
    >
    > Is this common? I'm trying to wrap my head around why you'd want to do
    > this this way and I'm not coming up with a lot.
    >
    > .red { color: red; }
    >
    > class="style1 red"
    >
    > is about the only thing I can think of where it seems like it might make
    > sense (not that specifically, but that sort of thing).
    >
    > I did look, briefly, at the CSS and both bar and group were rather
    > complicated, and shared a lot of the identical css settings, so I'm not
    > sure what the point was.


    well:

    <span class="left"><span class="red"><span class="italic"><a href
    class="linkstyle"
    href="http://www.example.com">example.com</a></span></span></span>

    vs:

    <a href class="linkstyle red left italic"
    href="http://www.example.com">example.com</a>

    Of course, you could create:

    leftredbold
    leftreditalic
    leftredbolditalic

    etc ......

    but it might be more efficient to just create a set of colours, a set of
    font effects, a set of aligns and combine them in the class attribute.

    Rgds

    Denis McMahon
    Denis McMahon, Feb 2, 2011
    #4
  5. Lewis

    richard Guest

    Re: Multiple classes (Re: This was interesting)

    On Wed, 2 Feb 2011 13:13:55 +0200, Jukka K. Korpela wrote:

    > Lewis wrote:
    >
    >> I was looking at some page source toady and I came across this:
    >>
    >> <div class="bar group">
    >>
    >> Pretty sure I've never seen that,

    >
    > It's actually rather common to have multiple classes listed in a class
    > attribute, especially since Netscape 4 (which didn't grok such constructs)
    > virtually died.
    >
    > By the way, "This was interesting" was about the most uninteresting heading
    > you can write. I wouldn't have looked at the message if they didn't pay me
    > for reading alt.html. Oh wait... what are you saying? The _don't_ pay me?
    > D'Oh!
    >
    >> so I did a little testing at it
    >> appears to apply both the .bar and .group styles to the div, but I
    >> have to wonder, WHY?

    >
    > Because that's what the specifications say.
    >
    >> Is this common?

    >
    > Rather common, especially when CSS is used in a relatively advanced way.
    >
    >> I'm trying to wrap my head around why you'd want to do
    >> this this way and I'm not coming up with a lot.
    >>
    >> .red { color: red; }
    >>
    >> class="style1 red"

    >
    > Not along those lines for sure. To begin with, the name "style1" says
    > virtually nothing, and "red" is worse because it easily gets misleading
    > (when, say, someone decides to render warnings not in red but in some other
    > prominent way). And without anything declared for "style1" anywhere, it's
    > presence is pointless.
    >
    > For example, suppose that you have a table where some cells contain numeric
    > data (and should therefore be right-aligned) and some cells are to be
    > highlighted, you might have CSS rules like
    >
    > .numeric { text-align: right; }
    > .highlight { background: #ffd; color: black; }
    >
    > And when you have a cell that contains numeric data _and_ should be
    > highlighted... what would you do in HTML markup?
    >
    > Yes, you would use <td class="numeric highlight">42</td>.


    look dickhead, I don't write my style sheets to appease your specific
    tastes. If I want to use "red" that's my damn business.
    however, I do try to avoid using class names that equal specific elements.
    So instead of "red" I would use maybe "ared".
    richard, Feb 2, 2011
    #5
  6. Re: Multiple classes (Re: This was interesting)

    richard the sto0pid wrote:

    > look dickhead,


    That should have been, "Thanks for the good information, dickhead."

    > If I want to use "red" that's my damn business.


    Since it is "your damn business," why do you even bother to ask for
    advice -- which you almost never accept. Or if you do, you never show
    any appreciation for it.

    Sincerely, why ask?

    --
    -bts
    -In a broadband world, you are just a dialup
    Beauregard T. Shagnasty, Feb 2, 2011
    #6
  7. Re: Multiple classes (Re: This was interesting)

    Sherm Pendley wrote:

    > "Beauregard T. Shagnasty" writes:
    >> Sincerely, why ask?

    >
    > It's called "trolling."
    >
    > Honestly, B. - haven't you been here long enough to recognize the
    > signs by now?


    I don't really think it is. Srsly, RtS isn't smart enough to troll.

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
    Beauregard T. Shagnasty, Feb 2, 2011
    #7
  8. Lewis

    dorayme Guest

    Re: Multiple classes (Re: This was interesting)

    In article <14gor7uls6vbe$>,
    richard <> wrote:

    > If I want to use "red" that's my damn business.
    > however, I do try to avoid using class names that equal specific elements.
    > So instead of "red" I would use maybe "ared".


    Why not "red"? I mean, given it is your damn business! <g>

    --
    dorayme
    dorayme, Feb 2, 2011
    #8
  9. Re: Multiple classes (Re: This was interesting)

    richard wrote:
    > On Wed, 2 Feb 2011 13:13:55 +0200, Jukka K. Korpela wrote:
    >
    >> Lewis wrote:
    >>
    >>> I was looking at some page source toady and I came across this:
    >>>
    >>> <div class="bar group">
    >>>
    >>> Pretty sure I've never seen that,

    >> It's actually rather common to have multiple classes listed in a class
    >> attribute, especially since Netscape 4 (which didn't grok such constructs)
    >> virtually died.
    >>
    >> By the way, "This was interesting" was about the most uninteresting heading
    >> you can write. I wouldn't have looked at the message if they didn't pay me
    >> for reading alt.html. Oh wait... what are you saying? The _don't_ pay me?
    >> D'Oh!
    >>
    >>> so I did a little testing at it
    >>> appears to apply both the .bar and .group styles to the div, but I
    >>> have to wonder, WHY?

    >> Because that's what the specifications say.
    >>
    >>> Is this common?

    >> Rather common, especially when CSS is used in a relatively advanced way.
    >>
    >>> I'm trying to wrap my head around why you'd want to do
    >>> this this way and I'm not coming up with a lot.
    >>>
    >>> .red { color: red; }
    >>>
    >>> class="style1 red"

    >> Not along those lines for sure. To begin with, the name "style1" says
    >> virtually nothing, and "red" is worse because it easily gets misleading
    >> (when, say, someone decides to render warnings not in red but in some other
    >> prominent way). And without anything declared for "style1" anywhere, it's
    >> presence is pointless.
    >>
    >> For example, suppose that you have a table where some cells contain numeric
    >> data (and should therefore be right-aligned) and some cells are to be
    >> highlighted, you might have CSS rules like
    >>
    >> .numeric { text-align: right; }
    >> .highlight { background: #ffd; color: black; }
    >>
    >> And when you have a cell that contains numeric data _and_ should be
    >> highlighted... what would you do in HTML markup?
    >>
    >> Yes, you would use <td class="numeric highlight">42</td>.

    >
    > look dickhead, I don't write my style sheets to appease your specific
    > tastes. If I want to use "red" that's my damn business.
    > however, I do try to avoid using class names that equal specific elements.
    > So instead of "red" I would use maybe "ared".


    Oh, now that's funny... a guy named Richard calling someone a 'dickhead'.


    --
    Norman
    Registered Linux user #461062
    AMD64X2 6400+ Ubuntu 8.04 64bit
    Norman Peelman, Feb 2, 2011
    #9
  10. Lewis

    Lewis Guest

    Re: Multiple classes (Re: This was interesting)

    In message <>
    Evan Platt <> wrote:
    > On Wed, 2 Feb 2011 09:24:27 -0700, richard <> wrote:


    >>look dickhead,


    > Wow, no wonder you have no friends.


    What's REALLY funny is that I am the one that posted the example.

    Ah well, I guess every group has a wormtail.

    --
    I said pretend you've got no money, she just laughed and said, 'Eh
    you're so funny.' I said, 'Yeah? Well I can't see anyone else smiling in
    here.'
    Lewis, Feb 3, 2011
    #10
  11. Re: Multiple classes (Re: This was interesting)

    Ed Mullen wrote:

    > Beauregard T. Shagnasty wrote:
    >> Sherm Pendley wrote:
    >>> "Beauregard T. Shagnasty" writes:
    >>>> Sincerely, why ask?
    >>>
    >>> It's called "trolling."
    >>>
    >>> Honestly, B. - haven't you been here long enough to recognize the
    >>> signs by now?

    >>
    >> I don't really think it is. Srsly, RtS isn't smart enough to troll.

    >
    > Perhaps that's the mark of a really really good troll?


    Sometimes, but not in the case of RtS. You're probably not as familiar
    with him over the years as some of us.

    --
    -bts
    -Four wheels carry the body; two wheels move the soul
    Beauregard T. Shagnasty, Feb 3, 2011
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Hubberstey

    "Interesting" behavior with aggregates

    Tim Hubberstey, Jun 25, 2004, in forum: VHDL
    Replies:
    6
    Views:
    1,809
    Tim Hubberstey
    Jun 30, 2004
  2. Simon Harvey
    Replies:
    5
    Views:
    426
    Scott M.
    Nov 16, 2003
  3. Jay
    Replies:
    1
    Views:
    349
    Chris Taylor
    Oct 2, 2003
  4. Elliot M. Rodriguez

    An interesting problem

    Elliot M. Rodriguez, Oct 21, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    380
    Elliot M. Rodriguez
    Oct 21, 2003
  5. Bilbo
    Replies:
    3
    Views:
    402
    Bilbo
    Nov 20, 2003
Loading...

Share This Page