prevent line end translate into white space

Discussion in 'HTML' started by Greg N., Jul 27, 2005.

  1. Greg N.

    Greg N. Guest

    The line end character translates into white space:

    <span style="background: red;">X</span>
    <span style="background: blue;">Y</span>
    <span style="background: green;">Z</span>

    This code generates three text boxes, separated by white spaces. If
    that's not what you want, you can prevent it this way:

    <span style="background: red;">X</span><span
    style="background: blue;">Y</span><span
    style="background: green;">Z</span>

    That works fine, but the code looks messy. Is there a clean way to have
    the browser *not* translate the line end into white space?

    --
    Gregor's Motorradreisen:
    http://hothaus.de/greg-tour/
    Greg N., Jul 27, 2005
    #1
    1. Advertising

  2. Greg N.

    jlbdoc95 Guest

    See if this will fit the bill for you:

    <div style="background: red; display: inline;">X</div>
    <div style="background: blue; display: inline;">Y</div>
    <div style="background: green; display: inline;">Z</div>


    "Greg N." <> wrote in message
    news:dc802v$o1j$...
    > The line end character translates into white space:
    >
    > <span style="background: red;">X</span>
    > <span style="background: blue;">Y</span>
    > <span style="background: green;">Z</span>
    >
    > This code generates three text boxes, separated by white spaces. If
    > that's not what you want, you can prevent it this way:
    >
    > <span style="background: red;">X</span><span
    > style="background: blue;">Y</span><span
    > style="background: green;">Z</span>
    >
    > That works fine, but the code looks messy. Is there a clean way to have
    > the browser *not* translate the line end into white space?
    >
    > --
    > Gregor's Motorradreisen:
    > http://hothaus.de/greg-tour/
    jlbdoc95, Jul 27, 2005
    #2
    1. Advertising

  3. On Wed, 27 Jul 2005 09:42:49 -0400, jlbdoc95 <albina@> wrote:

    [toppost fixed; do not toppost: quote the bit you reply to, attribute that too,
    and reply underneith]

    > "Greg N." <> wrote in message
    > news:dc802v$o1j$...
    >> The line end character translates into white space:
    >>
    >> <span style="background: red;">X</span>
    >> <span style="background: blue;">Y</span>
    >> <span style="background: green;">Z</span>
    >>
    >> This code generates three text boxes, separated by white spaces. If
    >> that's not what you want, you can prevent it this way:
    >>
    >> <span style="background: red;">X</span><span
    >> style="background: blue;">Y</span><span
    >> style="background: green;">Z</span>
    >>
    >> That works fine, but the code looks messy. Is there a clean way to have
    >> the browser *not* translate the line end into white space?
    >>


    You (Greg) can always put the inline elements inline. Like:
    <span>X</span><span>Y</span><span>Z</span>. In this nippet of yours it doesn't
    really matter that they are inline or that 'the code looks messy'. Perhaps you
    have a problem with a complicated document? Providing an URL gives more insight.

    > See if this will fit the bill for you:
    >
    > <div style="background: red; display: inline;">X</div>
    > <div style="background: blue; display: inline;">Y</div>
    > <div style="background: green; display: inline;">Z</div>
    >


    How is replacing an inline element with a block level element going to resolve
    having some white space displayed between the content of the elements? Even if
    they get the property 'display:inline;'? Did you (jlbdoc95) try this yourself?
    What results did you get[1]?

    >> --
    >> Gregor's Motorradreisen:


    Please cut out the sig(nature) if your newsclient doesn't do that for you.


    [1] Yes, I did try. No difference as was to be expected.
    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Jul 27, 2005
    #3
  4. Greg N.

    Greg N. Guest

    Barbara de Zoete wrote:

    > You (Greg) can always put the inline elements inline. Like:
    > <span>X</span><span>Y</span><span>Z</span>.


    that's what I said in my example, isn't it?

    > it doesn't really matter that they are inline or that
    > 'the code looks messy'.


    sure, functionally it does not matter. Did I imply otherwise?
    Anyway, I think well structured, clean, readable code does matter in
    terms of code maintainability. That's not really new news, is it?

    > Perhaps you have a problem with a complicated document?


    hmmm. are you trying to talk down on me?

    --
    Gregor's Motorradreisen:
    http://hothaus.de/greg-tour/
    Greg N., Jul 27, 2005
    #4
  5. On Wed, 27 Jul 2005 18:52:40 +0200, Greg N. <> wrote:

    > Barbara de Zoete wrote:
    >
    >> You (Greg) can always put the inline elements inline. Like:
    >> <span>X</span><span>Y</span><span>Z</span>.

    >
    > that's what I said in my example, isn't it?
    >


    That's not what I understood, when you gave the following:

    >>> <span style="background: red;">X</span><span
    >>> style="background: blue;">Y</span><span
    >>> style="background: green;">Z</span>


    I don't see how that is typed inline using three lines on purpose.

    >> it doesn't really matter that they are inline or that 'the code looks
    >> messy'.

    >
    > sure, functionally it does not matter. Did I imply otherwise?


    But funcionally it _does_ matter. The white space is gone.

    And being only a small bit of code, it doesn't matter that it looks messy. It
    doesn't. So yes, you did imply otherwise.

    > Anyway, I think well structured, clean, readable code does matter in terms of
    > code maintainability. That's not really new news, is it?
    >
    >> Perhaps you have a problem with a complicated document?

    >
    > hmmm. are you trying to talk down on me?
    >


    ? Fine. If not seeing why real code from a perhaps complicated document can
    clearify your problem for those you seek advise from, go solve your own problems
    then.

    Plonk
    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Jul 27, 2005
    #5
  6. Greg N.

    JDS Guest

    On Wed, 27 Jul 2005 19:22:17 +0200, Barbara de Zoete wrote:

    >>> Perhaps you have a problem with a complicated document?

    >>
    >> hmmm. are you trying to talk down on me?
    >>

    >
    > ? Fine. If not seeing why real code from a perhaps complicated document can
    > clearify your problem for those you seek advise from, go solve your own problems
    > then.


    Holy oversensitivity, Batman! (on both yer parts!)

    --
    JDS | lid
    | http://www.newtnotes.com
    DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/
    JDS, Jul 27, 2005
    #6
  7. Greg N.

    jlbdoc95 Guest

    "Barbara de Zoete" <> wrote in message
    news:eek:psukzfluix5vgts@zoete_b...
    > On Wed, 27 Jul 2005 09:42:49 -0400, jlbdoc95 <albina@>
    > wrote:
    >
    > [toppost fixed; do not toppost: quote the bit you reply to, attribute that
    > too, and reply underneith]
    >
    >> "Greg N." <> wrote in message
    >> news:dc802v$o1j$...
    >>> The line end character translates into white space:
    >>>
    >>> <span style="background: red;">X</span>
    >>> <span style="background: blue;">Y</span>
    >>> <span style="background: green;">Z</span>
    >>>
    >>> This code generates three text boxes, separated by white spaces. If
    >>> that's not what you want, you can prevent it this way:
    >>>
    >>> <span style="background: red;">X</span><span
    >>> style="background: blue;">Y</span><span
    >>> style="background: green;">Z</span>
    >>>
    >>> That works fine, but the code looks messy. Is there a clean way to have
    >>> the browser *not* translate the line end into white space?
    >>>

    >
    > You (Greg) can always put the inline elements inline. Like:
    > <span>X</span><span>Y</span><span>Z</span>. In this nippet of yours it
    > doesn't really matter that they are inline or that 'the code looks
    > messy'. Perhaps you have a problem with a complicated document? Providing
    > an URL gives more insight.
    >

    Greg, I guess it depends what you are trying to achieve.

    >> See if this will fit the bill for you:
    >>
    >> <div style="background: red; display: inline;">X</div>
    >> <div style="background: blue; display: inline;">Y</div>
    >> <div style="background: green; display: inline;">Z</div>

    Only for IE above, and this will fix it for all:
    <div style="background: red; display: inline; float: left;">X</div>
    <div style="background: blue; display: inline; float: left;">Y</div>
    <div style="background: green; display: inline; float: left;">Z</div>


    >>

    >
    > How is replacing an inline element with a block level element going to
    > resolve having some white space displayed between the content of the
    > elements? Even if they get the property 'display:inline;'? Did you
    > (jlbdoc95) try this yourself?

    With block elements, you can control the spacing, I just was a little quick
    on the trigger.

    > What results did you get[1]?

    Yes I had, but only in IE [2]
    >
    >>> --
    >>> Gregor's Motorradreisen:

    >
    > Please cut out the sig(nature) if your newsclient doesn't do that for you.
    >
    >
    > [1] Yes, I did try. No difference as was to be expected.

    [2] Guess I should have tried it out in FF/Moz
    jlbdoc95, Jul 27, 2005
    #7
  8. On Wed, 27 Jul 2005 14:13:23 -0400, JDS <> wrote:

    > Holy oversensitivity, Batman! (on both yer parts!)
    >


    No, not oversensitive.

    Just not willing to tiptoe around when the other party is around too. Not
    interested in why he thought I was talking him down. Not interested in
    discussing his emotional perception of this medium. Not willing to invest in 'a
    long lasting relationship'. I see nothing coming of all of that.

    Just want to keep my [inbox] clean. That's all.

    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
    Barbara de Zoete, Jul 27, 2005
    #8
  9. Greg N.

    Neredbojias Guest

    With neither quill nor qualm, Barbara de Zoete quothed:

    > No, not oversensitive.
    >
    > Just not willing to tiptoe around when the other party is around too. Not
    > interested in why he thought I was talking him down. Not interested in
    > discussing his emotional perception of this medium. Not willing to invest in 'a
    > long lasting relationship'. I see nothing coming of all of that.
    >
    > Just want to keep my [inbox] clean. That's all.


    If I get this correctly, you're a woman who likes one-night-stands and
    condoms??

    --
    Neredbojias
    Contrary to popular belief, it is believable.
    Neredbojias, Jul 28, 2005
    #9
    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. neverstill
    Replies:
    1
    Views:
    525
    neverstill
    Dec 5, 2003
  2. Ben C
    Replies:
    6
    Views:
    2,133
    Leif K-Brooks
    Jan 28, 2007
  3. Spiros Bousbouras

    White space at the end of a line

    Spiros Bousbouras, Dec 3, 2007, in forum: C Programming
    Replies:
    15
    Views:
    475
    Spiros Bousbouras
    Dec 5, 2007
  4. j1c
    Replies:
    5
    Views:
    116
  5. Replies:
    2
    Views:
    111
Loading...

Share This Page