Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 04:19 PM
Jim Vorbau
Guest
 
Posts: n/a
Default Changing color on consecutive letters.

I would like to change the colors on consecutive letters of a word.
When adding a style associated with the span tag (see below), there is
a gap after each letter. Does anyone know why the span tag does this?
Is there a better way (or better tag) to accomplish what I'm trying to
do?

Thanks much!

- Jim

<html>
<body>
Here is some text.
<span style="color: fuchsia; background: white">H</span>
<span style="color: white; background: fuchsia">e</span>
<span style="color: fuchsia; background: white">l</span>
<span style="color: white; background: fuchsia">l</span>
<span style="color: fuchsia; background: white">o</span>.
Here is some more text.
</body>
</html>
  #2  
Old July 20th, 2005, 04:20 PM
David Walker
Guest
 
Posts: n/a
Default Re: Changing color on consecutive letters.

> The span tag doesn't do anything. What you have minus the spans is[color=blue]
> H
> e
> l
> l
> o.[/color]

Yep - just to clarify that though, although html ignores line breaks during
code, which may make you think you can have them anywhere, they do still
appear as a space in the text. Its a common problem for people with sites
that have images that need to match up exactly.

David


  #3  
Old July 20th, 2005, 04:20 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Changing color on consecutive letters.

"David Walker" <wbsdavenews@hotmail.com> wrote:
[color=blue]
> Yep - just to clarify that though, although html ignores line
> breaks during code, which may make you think you can have them
> anywhere, they do still appear as a space in the text.[/color]

What makes you think HTML ignores line breaks?

In HTML, a line break is in most situations equivalent to a space.

In the given example, immediately after an end tag, they _should_ be
ignored (according to the SGML standard and HTML specifications), but
almost all browsers have always got this wrong.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

  #4  
Old July 20th, 2005, 04:20 PM
Kris
Guest
 
Posts: n/a
Default Re: Changing color on consecutive letters.

In article <bfu2ag$2th$1@wisteria.csv.warwick.ac.uk>,
"David Walker" <wbsdavenews@hotmail.com> wrote:
[color=blue][color=green]
> > The span tag doesn't do anything. What you have minus the spans is
> > H
> > e
> > l
> > l
> > o.[/color]
>
> Yep - just to clarify that though, although html ignores line breaks during
> code, which may make you think you can have them anywhere, they do still
> appear as a space in the text. Its a common problem for people with sites
> that have images that need to match up exactly.[/color]

And often, when copying the text from a browser to another application,
the white space (tabs, spaces, double spaces, etc.) are copied with it.
This often creates effects unforseen by the author.

--
Kris
kristiaan@xs4all.netherlands (nl)
"We called him Tortoise because he taught us" said the Mock Turtle.
  #5  
Old July 20th, 2005, 04:20 PM
Headless
Guest
 
Posts: n/a
Default Re: Changing color on consecutive letters.

"David Walker" <wbsdavenews@hotmail.com> wrote:
[color=blue][color=green]
>> What makes you think HTML ignores line breaks?[/color]
>
>I didn't mean ignore completely, just ignore in the sense that if you put a
>line break in the middle of a chunk of text, the text when renedered won't
>have that line break. I did say they apear as a space when rendered.[/color]

Depends:

<pre>
Foobar
Foobar
Foobar
</pre>


Headless

  #6  
Old July 20th, 2005, 04:20 PM
Stan Brown
Guest
 
Posts: n/a
Default Re: Changing color on consecutive letters.

In article <bfv9ta$dm8$1@wisteria.csv.warwick.ac.uk> in
comp.infosystems.www.authoring.html, David Walker
<wbsdavenews@hotmail.com> wrote:[color=blue][color=green]
>> What makes you think HTML ignores line breaks?[/color]
>
>I didn't mean ignore completely, just ignore in the sense that if you put a
>line break in the middle of a chunk of text, the text when renedered won't
>have that line break. I did say they apear as a space when rendered.[/color]

"'When _I_ use a word,' Humpty Dumpty said in rather a scornful
tone, 'it means just what I choose it to mean -- neither more nor
less.'"

:-)

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
  #7  
Old July 20th, 2005, 04:20 PM
Stan Brown
Guest
 
Posts: n/a
Default Re: Changing color on consecutive letters.

In article <bg1741$c5$1@wisteria.csv.warwick.ac.uk> in
comp.infosystems.www.authoring.html, David Walker
<wbsdavenews@hotmail.com> wrote:[color=blue]
>I think it is clear from that that I said that it ignores the line breaks
>(as a line break) in html, "but they appear as a space"!!!![/color]

Apparently the point of my quote from Lewis Carroll was not clear:
Your original statement that line breaks are "ignored" was wrong.
When that was pointed out (not by me), you tried to redefine
"ignore" and create a distinction between your newly-redefined word
and "ignore completely".
[color=blue]
>Its like being back at school having my essays checked! Sheesh! :o/[/color]

The difference is that here on Usenet everyone _chooses_ to put his
or her work up for criticism. No one need do it who does not wish
to. When you or I or anyone makes a false statement instead of
being silent, we can hardly then turn around and complain that we
are being "checked".

A grownup would say (or at least think) "Thank you for the
correction. Now I know something I didn't know before." I think most
of the regulars have had occasion to do that on occasion: certainly
I have.

Anyway, if your work was being checked I'd have something to say
about your use of the third person neuter present indicative of the
verb "to be".

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
  #8  
Old July 20th, 2005, 04:20 PM
Jukka K. Korpela
Guest
 
Posts: n/a
Default Re: Changing color on consecutive letters.

"David Walker" <wbsdavenews@hotmail.com> wrote:
[color=blue]
> I still stand by what I said:
>
> "Yep - just to clarify that though, although html ignores line
> breaks during code,[/color]

Well, if you insist, let us take a look at that exact statement.
It is patently false even in ways discussed yet. In _code_, i.e. in
tags, entity references, character references and (in theory) other
constructs that can reasonably be called HTML _code_, line breaks are
surely not ignored and in most cases not even equivalent to spaces.
Consider this:

<
title>Demo</tit
le>
&cop
y; Yucca

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles