& thinsp ;, & ensp ;, & emsp; alternatives in Safari browser

& thinsp; & ensp; & emsp; in the Safari browser.

spaces

This is a thin space, n-size space, m-size space that works in other browsers.

thinsp: a & thinsp; b & thinsp; c & thinsp; d & thinsp; e & thinsp; f & thinsp; g

ensp: a & ensp; b & ensp; c & ensp; d & ensp; e & ensp; f & ensp; g

emsp: a & emsp; b & emsp; c & emsp; d & emsp; e & emsp; f & emsp; g

Are there any alternatives for them in Safari?

+8
html safari
source share
3 answers

This may be a font problem; this can help indicate a font containing glyphs for fixed-width spaces used. Most fonts are missing. Good browsers don't need glyphs, but instead increase the distance between other characters.

However, a more robust approach is to use CSS methods to add spacing, mainly to padding properties, and for spaces of text where a specific spacing between all letters is required, the letter-spacing . Using the latter, note that it adds a space after the last character. My page in Unicode space shows the specific or typical widths of "fixed width spaces" such as THIN SPACE (which arent all really fixed widths). But it's probably best to start with the amount of the desired interval in em units (font size) and just forget the spaces of a fixed width.

Another possibility is to use the regular SPACE character, but wrap it in a span and set its width. This requires an inline block. This approach is better than higher when the desired non-CSS reserve is regular space and not the absence of any interval. Please note that search engines should be considered CSS ignorant, so this approach has to do with the fact that they โ€œseeโ€ the word space between characters (for example, to see โ€œfoo barโ€ and not โ€œfoo barโ€ when you want, so that the space is a fixed width between the words "foo" and "bar"). And as usual, you can use NO-BREAK SPACE instead of SPACE to prevent line breaks.

Example:

 .thin { display: inline-block; width: 0.2em; } 
 <div style="font-size: 200%"> <div>ab (normal space)</div> <div>a&thinsp;b (thin space)</div> <div><span style="padding-right: 0.2em">a</span>b (0.2em padding)</div> <div><span style="letter-spacing: 0.2em">ab</span> (0.2em letter spacing)</div> <div>a<span class=thin> </span>b (space set to 0.2em width)</div> <div>a<span class=thin>&nbsp;</span>b (no-break space set to 0.2em width)</div> </div> 
+9
source share

This issue seems to be fixed. Anyway, I can not reproduce it. I tested four common fonts. Here is the test page:

http://burtonsys.com/test_html_spaces.html

I don't have an Apple device, but I used a couple of cross-browser validation websites to test using Safari. It seems that all the mileage characters work fine, both in Safari 9.1.3 and Safari 7.1.

+2
source share

I wanted to align the fields in the form and use   in the span using style="padding-left: 0.7em in front of the input element. Then I adjusted each em to align the boxes with 0.4em , 0.85em , 0.95em and 1.3em , which are all lined up in an input field that did not require any adjustments.

0
source share

All Articles