prevent line end translate into white space

G

Greg N.

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?
 
J

jlbdoc95

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>
 
B

Barbara de Zoete

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

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]?

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 |
`-------------------------------------------------- --<--@ ------------'
 
G

Greg N.

Barbara said:
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?
 
B

Barbara de Zoete

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

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

I don't see how that is typed inline using three lines on purpose.
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?


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 |
`-------------------------------------------------- --<--@ ------------'
 
J

JDS

? 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!)
 
J

jlbdoc95

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

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.
Only for IE above, and this will fix it for all:
<div style="background: red; display: inline; float: left;">X</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]

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
 
B

Barbara de Zoete

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 |
`-------------------------------------------------- --<--@ ------------'
 
N

Neredbojias

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??
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top