473,387 Members | 1,573 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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>
Jul 20 '05 #1
7 5280
> The span tag doesn't do anything. What you have minus the spans is
H
e
l
l
o.


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
Jul 20 '05 #2
"David Walker" <wb*********@hotmail.com> wrote:
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.


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

Jul 20 '05 #3
In article <bf**********@wisteria.csv.warwick.ac.uk>,
"David Walker" <wb*********@hotmail.com> wrote:
The span tag doesn't do anything. What you have minus the spans is
H
e
l
l
o.


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.


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
kr*******@xs4all.netherlands (nl)
"We called him Tortoise because he taught us" said the Mock Turtle.
Jul 20 '05 #4
"David Walker" <wb*********@hotmail.com> wrote:
What makes you think HTML ignores line breaks?


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.


Depends:

<pre>
Foobar
Foobar
Foobar
</pre>
Headless

Jul 20 '05 #5
In article <bf**********@wisteria.csv.warwick.ac.uk> in
comp.infosystems.www.authoring.html, David Walker
<wb*********@hotmail.com> wrote:
What makes you think HTML ignores line breaks?


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.


"'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/
Jul 20 '05 #6
In article <bg*********@wisteria.csv.warwick.ac.uk> in
comp.infosystems.www.authoring.html, David Walker
<wb*********@hotmail.com> wrote:
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"!!!!
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".
Its like being back at school having my essays checked! Sheesh! :o/


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/
Jul 20 '05 #7
"David Walker" <wb*********@hotmail.com> wrote:
I still stand by what I said:

"Yep - just to clarify that though, although html ignores line
breaks during code,


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

Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Fuzzyman | last post by:
Sorry if my terminology is wrong..... but I'm having intermittent problems dealing with accented characters in python. (Only from the 8 bit latin-1 character set I think..) I've written an...
7
by: Frostillicus | last post by:
Hi, I've written some javascript to randomly choose a classical music composer's picture and sample audio and display it on my home page (http://marc.fearby.com/), and this works fine in Mozilla...
4
by: joiv | last post by:
I'm making a <select></select> with lots of <option></option>. It contains all possible options. Because of the length of the list, I also have an <input type="text">. This is what I wish to do:...
9
by: vindhya | last post by:
I have a small query. If I have a character from alphabets and I want to change case of the same then how is it possible ? Here are the solutions, but can you suggest any other solution may be...
1
by: Linda | last post by:
Hi, Is there a way to do a "text" (rather than "binary") compareison with the "like" operator, without changing the global "Option Compare" setting? I don't want to risk breaking many, many...
7
by: Fabien LE LEZ | last post by:
Hello, I'd like to put, on a web page, a "place" where the user can type a rather long text, with automatic coloring of each word (e.g. a color depending on the number of letters of the word). ...
8
by: flyingisfun1217 | last post by:
Hey, Sorry to bother everybody again, but this group seems to have quite a few knowledgeable people perusing it. Here's my most recent problem: For a small project I am doing, I need to...
1
by: mkk572ny | last post by:
Hi, I was wondering if anyone could help me to create a java method to changing the uppercase letters to lowercase and visa versa in a string using a for-loop. Thanks.
12
by: jackson.rayne | last post by:
Hello, I am a javascript newbie and I'm stick at one place. I have a requirement where I will get a sentence in a variable example var v1 ="This is a sentence"
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.