Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:27:59+00:00 2026-06-09T01:27:59+00:00

I would have assumed that setting letter-spacing to -1px on a two-character span would

  • 0

I would have assumed that setting letter-spacing to -1px on a two-character span would reduce its width by 1px. However, see the following in Chrome:

span.style.fontSize=48
48
span.textContent="99"
"99"
span.style.letterSpacing=0
0
span.offsetWidth
16
span.style.letterSpacing="-1px"
"-1px"
span.offsetWidth
14

Setting letter-spacing to -1px has reduced the width by 2px rather than 1.

This might be less important if it did not cause the text with letter-spacing of -1px to be slight off-center when you are trying to align it with text-align: center.

The CSS spec appears to say clearly that letter-spacing is supposed to affect spacing between letters. However, it seems that at least in Chrome the spacing between some conceptual start point and the first character of text is also compressed.

Any ideas or thoughts on this? IE 10 exhibits the same behavior. A bug? Or misreading of the spec?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:28:02+00:00Added an answer on June 9, 2026 at 1:28 am

    The Behavior

    I agree that the spec states this fairly explicitly. To quote this page:

    Letter-spacing must not be applied at the beginning or at the end of a
    line.

    However, this fiddle on Win 7 is showing me that on Chrome, IE9, and Firefox, all are applying one less pixel after the last letter (Firefox is showing me to start out with one less pixel to begin with in the gap to the border), which seems to be in violation of it not being applied to the end of the line. The result being that all appear to be reducing total width by 1px per character in the string.

    So it does not appear that it works as is should in any browser, nor does it matter if the letter-spacing is instead a positive number.

    Probably the “Best” Workaround

    Add padding-right: 1px to the span with letter-spacing: -1px to offset the problem as seen in this fiddle.

    Optional Workaround: :after pseudo-element

    On the span with letter-spacing: -1px put the following as seen in this fiddle:

    span:after {content:''; display: inline-block; width: 1px;}
    

    Final Thought

    Either solution above may or may not help with differences in text-align: center calculations, as that appears to partially depend on the 1px rounding for center based on the display width, as seen when one stretches the width of this fiddle).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's assume that I have a complex hash reference $hash_ref , and I would
I would have thought that this would be an easy thing to do, but
I have found possible slowdown in my app so I would have two questions:
Basically each entity would have a collection of feeding behaviors that it would follow.
Basically, now that APC is installed, I had assumed that memory tracing would show
Assume I have the following input in Pig: some And I would like to
Assume I have this model : class Task(models.Model): title = models.CharField() Now I would
Lets assume we have a class car. How would You name parameters of function
I would have thought this one would be simple but I'm trying to change
I would have expected the following C# program to only print EOF! once I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.