CSS Letter-spacing

Soldato
Joined
24 Nov 2002
Posts
16,378
Location
38.744281°N 104.846806°W
I'm currently using "letter-spacing: 0.7em;" to seperate out some characters, however as I'm using a differnt colour background for each character, they're no longer centralised:

|A ||B |

instead of

| A || B |

Tabulating/divs isn't an option as there are hundreds of letters.... :confused:
 
If each character has a different background then surely they are encased in an element? Padding is the likely answer.
 
psyr33n said:
If each character has a different background then surely they are encased in an element? Padding is the likely answer.
Padding is indeed the ideal answer, but I can't use that as is as some 'characters' are actually double digits so it forces the whole thing off.

e.g. imagine:
Code:
1 2 3 4 ........ 242526.......101102103......
A B C D ........ X Y Z.........* / -.......
 
Only thing I can think of is a fixed grid with widths, for example a table or floating the characters with set widths.
 
psyr33n said:
Only thing I can think of is a fixed grid with widths, for example a table or floating the characters with set widths.
Yeah... but these things would have 15,000 cells... eating up loading time (IE struggles with big tables).

In the end, I split every character set down into a single character and then padded those:

1 - - - - - 1 0 - - - - 1 0 0 - - -...

(instead of 1 - - - - - 10 - - - - - 100 - - - - -)

Cheers for your help :)

Simple things are really bugging me lately.
 
psyr33n said:
What's this in aid of, may I ask? :P
You'll see another post later in the week about a *major* problem I'm having.

I'm basically trying to process sequences, this thread was about numbering the length of the sequences with a ruler if you imagine it!

Next weeks thread will be about extracting co-ordinates for shared sequences.

I have a needle (defg) and three haystacks:

1 abcdefghijklmn
2 aljoidefgjsaoo
3 asfsdffadfasji

I want the co-ords of the needle, something like:

row1/character5->row1/character7xrow2/ch5/->row2/ch7

Imagine drawing a box around it.

at the end, for each needle I need:
vertical start point (first row no.)
vertical end point (last row no.)
horizontal start point (will be same vertically)
horizontal end point (will be same vertically)

That made no sense.... :D
 
Back
Top Bottom