http://qs1969.pair.com?node_id=409420

The "Other Users" nodelet has entries such as the following (line breaks added for readability):

<span class='even-row'> <span class='item-022'> <span class='user-243505'> <a title="im2's home node" href="?node_id=243505">im2</a> </span></span></span> <br />

Could this be changed to the following, for those which have span.user-243505 { display:none; } /* hide im2 in OU list */ in their CSS:

<span class='even-row'> <span class='item-022'> <span class='user-243505'> <a title="im2's home node" href="?node_id=243505">im2</a> <br /> </span></span></span>

We're currently being left with a blank link in Other Users.

Would that affect anyone in an unintended manner? It would screw up even-odd rows for those who use "display: none" on a row, but the choice is between that and a blank row.

Replies are listed 'Best First'.
Re: HTML change for Other Users
by hossman (Prior) on Nov 22, 2004 at 07:37 UTC

    The more I play with CSS, the more I love it...

    You can work arround this problem (at least on my browser) using this...

    tr[id~=nodelet_body_row_Other_Users] * br { display: none; } tr[id~=nodelet_body_row_Other_Users] * a:after,:before { content: "\A" +; white-space: pre; }
Re: HTML change for Other Users
by castaway (Parson) on Nov 22, 2004 at 09:56 UTC
    Patched.

    C.

Re: HTML change for Other Users
by hostyle (Scribe) on Nov 22, 2004 at 10:21 UTC

    Is there any reason why it isn't in the following syntax?

    <span class='even-row item-022 user-243505'> <a title="im2's home node" href="?node_id=243505">im2</a> <br /> </span>

    ie. specify multiple classes at once

      IANAPmdev, but I would guess that it's simpler for the HTML generation to separate them. Then you can do a simple loop like:

      1. foreach property
      2. add span with correct class for the property

      Otherwise you have to do something like:
      1. foreach property
      2. add it to a list
      3. foreach property in the list
      4. add it to the classes for The One Span

      UPDATE: Don't know if it applies to PM's home-grown tags, styles, etc, but that would not be legal in w3c .css.

      Only a single class is allowed within the tag it "modifies."

      See Ven'Tatsu's below. He is correct and my statement was wrong. (Next para is still true, but less relevant to css vers > 2.0

      <sometag class="1" style="2; 3; 4;">

      is allowed, but 2, 3 and 4 must be defined css elements. I'n not aware of any good way to make them refer to "roll-your-owns."

      UPDATE: However, read also the note at the end of §5.8.3 at http://www.w3.org/TR/CSS21/selector.html

      Typical (and ugly) workarounds involve creating compound styles

      .c { text-align: center; } .cb { text-align: center; font-weight: bold; } .cbr { text-align: center; font-weight: bold; color: red; background-color: transparent; } .cbri (or whatever, ad nauseum)...

      or the even-uglier use of multiple <span> tags; eg

      <p class="c"><span class="b"><span class="r">fubar whatever.... </span +></span></p>

      UPDATE: To my mind the "compound" style declaration above is on the same order of ugliness as the multi-classing in w3c's pages cited in this node and in Ven'Tatsu's. It may, however, be more readable.

        That was the case in CSS 1.0, in 2.0 and later you can group classes in a single tag.
        From http://www.w3.org/TR/CSS21/selector.html:
        [att~=val]
        Match when the element's "att" attribute value is a space-separated list of "words", one of which is exactly "val". If this selector is used, the words in the value must not contain spaces (since they are separated by spaces).
        And later
        Working with HTML, authors may use the period (.) notation as an alternative to the ~= notation when representing the class attribute. Thus, for HTML, div.value and div[class~=value] have the same meaning.
        This means that some browsers that don't understand newer CSS may have trouble with multiple classes in a single tag, but I don't know of any off the top of my head.
        Only a single class is allowed within the tag it "modifies."

        Really?

        Can you cite your source on that? I don't remember seeing it in any of the XHTML/CSS specs.

      Because the way it is works in more browsers.

      - tye