(https://i.sstatic.net/fzSnPIe6.png)
I tried reducing right padding 2px yet it didn’t remove the line spacing after E.(https://i.sstatic.net/lGzbVcw9.png)
I have also tried making the right margin -2px(https://i.sstatic.net/3GqaSJLl.png).It does reduce the margin by 2 but not the content space by 2.Is there any property which can reduce the content width from the right by 2px?
2
Answers
You could use
padding
, it will not remove letter spacing from last character but it will manage space equally for left and right.You can also do it like this e.g.:-
you are probably approaching the problem in an incorrect way. The problem is not that there is space after the last E in the word SALE. The actual problem is that the text is not center aligned in the
<p>
element that you have used.The paragraph element is not ideal for this use case. You should be using a
<div>
instead.<p>
is used when you have a paragraph of reading content. Your "sale" sign is more of a decorative text.Try out something like this:
Note how I avoid using exact values in
top
andleft
and usetransform
instead. This is so that if I change the text from "Sale" to something else (like "sale 50% off"), I will not have to recalculate the coordinates.Hope this helps.