forcing SPAN elements together in a single row

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ted Zlatanov

    forcing SPAN elements together in a single row

    Hello,

    my problem is very simple. I have:

    <div id="enclosing" >
    <div id="d1">
    <span id="s1">S1</span>
    <span id="s2">S2</span>
    <span id="s3">S3</span>
    </div>
    </div>

    I'd like these three SPAN elements to always stay in one row, instead of
    wrapping to the next line if the "enclosing" DIV is too small. It's OK
    to force scrollbars, since the arrangement is more important than
    visibility in this particular case.

    I can artifically achieve this by setting the "d1" width to 1000% but
    that's ugly and I'm sure I'm missing something obvious. I could also
    use a table but want a CSS solution if possible.

    Thank you very much for any help.

    Ted
  • Jonathan N. Little

    #2
    Re: forcing SPAN elements together in a single row

    Ted Zlatanov wrote:
    Hello,
    >
    my problem is very simple. I have:
    >
    <div id="enclosing" >
    <div id="d1">
    <span id="s1">S1</span>
    <span id="s2">S2</span>
    <span id="s3">S3</span>
    </div>
    </div>
    >
    I'd like these three SPAN elements to always stay in one row, instead of
    wrapping to the next line if the "enclosing" DIV is too small. It's OK
    to force scrollbars, since the arrangement is more important than
    visibility in this particular case.
    >
    I can artifically achieve this by setting the "d1" width to 1000% but
    that's ugly and I'm sure I'm missing something obvious. I could also
    use a table but want a CSS solution if possible.
    #d1 { white-space: nowrap; }

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO

    Comment

    • dorayme

      #3
      Re: forcing SPAN elements together in a single row

      In article <d4ba7$471cc258 $40cba7c2$18606 @NAXS.COM>,
      "Jonathan N. Little" <lws4art@centra lva.netwrote:
      Ted Zlatanov wrote:
      Hello,

      my problem is very simple. I have:

      <div id="enclosing" >
      <div id="d1">
      <span id="s1">S1</span>
      <span id="s2">S2</span>
      <span id="s3">S3</span>
      </div>
      </div>

      I'd like these three SPAN elements to always stay in one row, instead of
      wrapping to the next line if the "enclosing" DIV is too small. It's OK
      to force scrollbars, since the arrangement is more important than
      visibility in this particular case.

      I can artifically achieve this by setting the "d1" width to 1000% but
      that's ugly and I'm sure I'm missing something obvious. I could also
      use a table but want a CSS solution if possible.
      >
      How would a table help this problem?


      #d1 { white-space: nowrap; }
      --
      dorayme

      Comment

      • Jonathan N. Little

        #4
        Re: forcing SPAN elements together in a single row

        dorayme wrote:
        In article <d4ba7$471cc258 $40cba7c2$18606 @NAXS.COM>,
        "Jonathan N. Little" <lws4art@centra lva.netwrote:
        >
        >Ted Zlatanov wrote:
        >>Hello,
        >>>
        >>my problem is very simple. I have:
        >>>
        >><div id="enclosing" >
        >> <div id="d1">
        >> <span id="s1">S1</span>
        >> <span id="s2">S2</span>
        >> <span id="s3">S3</span>
        >> </div>
        >></div>
        >>>
        >>I'd like these three SPAN elements to always stay in one row, instead of
        >>wrapping to the next line if the "enclosing" DIV is too small. It's OK
        >>to force scrollbars, since the arrangement is more important than
        >>visibility in this particular case.
        >>>
        >>I can artifically achieve this by setting the "d1" width to 1000% but
        >>that's ugly and I'm sure I'm missing something obvious. I could also
        >>use a table but want a CSS solution if possible.
        >
        How would a table help this problem?
        Simple, it wouldn't.
        >#d1 { white-space: nowrap; }
        This will however.

        --
        Take care,

        Jonathan
        -------------------
        LITTLE WORKS STUDIO

        Comment

        • dorayme

          #5
          Re: forcing SPAN elements together in a single row

          In article <7dc8$471d584b$ 40cba7c2$3525@N AXS.COM>,
          "Jonathan N. Little" <lws4art@centra lva.netwrote:
          >I can artifically achieve this by setting the "d1" width to 1000% but
          >that's ugly and I'm sure I'm missing something obvious. I could also
          >use a table but want a CSS solution if possible.
          How would a table help this problem?
          >
          Simple, it wouldn't.
          >
          #d1 { white-space: nowrap; }
          >
          This will however.
          It sure will. I was convinced the first time I read it.

          (In fact, JL, you convince me so much about so many things that I
          reckon you could wangle money out of me with any lowdown scheme.
          This is the basis of a lot of con tricks. You gain the trust of
          the victim and then pow... like in "Tin Men" where the aluminium
          cladding salesman would drop a $5 on the carpet of his victim's
          house and then pretend to find it and "Oh, look, you must have
          dropped this" says he to show what an honest fellow he is... the
          sale is practically his then... <g>)

          --
          dorayme

          Comment

          • Jonathan N. Little

            #6
            Re: forcing SPAN elements together in a single row

            dorayme wrote:
            In article <4736b$471d61cf $40cba7c2$5520@ NAXS.COM>,
            "Jonathan N. Little" <lws4art@centra lva.netwrote:
            >
            >Hey, I saw that one! It was good. Many of yours with Bud-man or whatever
            >I have not watched.
            >
            Officer Bud White? Ah, there are only very few films that are any
            good with him in them.
            >
            La Confidential
            Master and Commander (a rollicking good tale)
            Gladiator
            The Sum of Us
            Proof
            Not seen any of those. Is this Crowe? I saw him in A Beautiful
            Mind...okay but I was underwhelmed.

            --
            Take care,

            Jonathan
            -------------------
            LITTLE WORKS STUDIO

            Comment

            • dorayme

              #7
              Re: forcing SPAN elements together in a single row

              In article <8999d$471d6ffd $40cba7c2$8838@ NAXS.COM>,
              "Jonathan N. Little" <lws4art@centra lva.netwrote:
              dorayme wrote:
              In article <4736b$471d61cf $40cba7c2$5520@ NAXS.COM>,
              "Jonathan N. Little" <lws4art@centra lva.netwrote:
              Hey, I saw that one! It was good. Many of yours with Bud-man or whatever
              I have not watched.
              Officer Bud White? Ah, there are only very few films that are any
              good with him in them.

              La Confidential
              Master and Commander (a rollicking good tale)
              Gladiator
              The Sum of Us
              Proof
              >
              Not seen any of those. Is this Crowe? I saw him in A Beautiful
              Mind...okay but I was underwhelmed.
              Yes. He just looked like he was acting in the film you refer to.
              It was weak. In the boxing film, Cinderella Man, ditto. There
              have been some very good boxing films, of course, The Set-Up, a
              1949 movie with Robert Ryan, directed by Robert Wise. An
              uncompromisingl y fine film. Also Raging Bull (De Niro). In modern
              times, brilliant for the first two thirds, Million Dollar Baby
              (Eastwood), I did not like the melodramatic last third... I still
              feel a terrible rage against the no good low down cheating fink
              woman boxer who landed the heroine into paralysis. And I have
              complained to Eastwood about letting this woman do quite such an
              uncompromising thing to her opponent. I don't care if he did
              follow the book. People's lives are at stake, following a book is
              pretty pathetic. Anything can happen in a book. But not anything
              can happen in a good book or film...

              --
              dorayme

              Comment

              • Jonathan N. Little

                #8
                Re: forcing SPAN elements together in a single row

                Ted Zlatanov wrote:
                On Mon, 22 Oct 2007 22:11:30 -0400 "Jonathan N. Little" <lws4art@centra lva.netwrote:
                >
                JNLdorayme wrote:
                >>How would a table help this problem?
                >
                JNLSimple, it wouldn't.
                >
                I'm sorry to have confused the issue. Inside the spans I need images,
                not just text. With tables I can force a row of N images side by
                side, which is what I was alluding to:
                So?

                IMG are inline elements by default *IF* you don't trigger quirks mode or
                have img { display: block; } in your stylesheet.

                #d1 { white-space: nowrap; }

                Will still fix your problem...


                --
                Take care,

                Jonathan
                -------------------
                LITTLE WORKS STUDIO

                Comment

                • Bergamot

                  #9
                  Re: forcing SPAN elements together in a single row

                  Jonathan N. Little wrote:See also
                  An organizational list of all elements in HTML 4.01.


                  --
                  Berg

                  Comment

                  Working...