Letter spacing in CSS?
- Started
- Last post
- 11 Responses
- bainbridge
This is bugging me.
Is there a way to stop the letter spacing from occuring after the final letter?
When I try to center large text, CSS adds extra space after the final letter in a word so it isn't visually centered.
- sisu0
I have experienced this.... Assuming you have "letter-spacing:" set to something?
- vaxorcist0
I can only imagine some insane jQuery dynamic page re-write
- sisu0
If so, you can't get rid of it to my knowledge. The only thing you can do is add padding to the left side to re-align the mis-aligned text. For example:
h1 {
letter-spacing:6px;
padding-left:6px;
}
- bainbridge0
^ Yes, I have "letter-spacing:" set to 3px.
That seems like a good solution.
- bainbridge0
My biggest issue actually is that I can't UNDERLINE the text without the line extending.
Any ideas for that?
- vaxorcist0
maybe some PHP....
where you use the wordwrap function, and then take the last character of each line, for that character, you wrap it in a CSS class that's NOT underlined or letter-spaced... or somehow done differently....
- vaxorcist0
hopefully this isn't mangled....
<?
$string = "Hello there, this is my long string of text, it goes on and on...
and it seems to go on foreer, long enough to type lorem ipsom for a while";
$number_of_chars_per_line=60;$list_of_lines=split('SPLIT',wordwrap($string,$number_of_chars_per_line,"SPLIT"));
for($i=0;$i<sizeof($list_of_lines);$i++){
$line = $list_of_lines[$i];
$all_but_the_last_char = substr($line, 0, -1);
$the_last_char = substr($line, -1, 1);
print "<p class='whatever'>\n";
print "$all_but_the_last_char";
print "<b class='lastchar'>$the_last_char</strong>\n";
print "</p>\n\n";
}
?>
- vaxorcist0
whoops... <b class='lastchar'>$the_last_char</strong>
- vaxorcist0
oops....should be
<b class='lastchar'>$the_last_char</strong>
/b should be at the end, not /strong
- vaxorcist0
ah.... QBN is mangling /b to make it /strong...
- vaxorcist0
it's 2am and I'm procrastinating on debugging something else, can't you tell(!)