1

The character used in this question examples is the period, it appears that all characters behave the same way. Why does the period trail after the hyperlink by one space character when coded like this:

You can become one of us 
    <a href="http://www.somedomain.com/oneOfUs/allYourBaseAreBelongToUs/">
here
</a>
.

I checked the ascii character array for the above and it looks to be a simple space: 104 101 114 101 32 46

vs no trailing space after the hyperlink when coded like this:

You can become one of us 
    <a href="http://www.somedomain.com/oneOfUs/allYourBaseAreBelongToUs/">here</a>.

The ascii character array for the above contains no space in output, but providing the character array for output comparison: 104 101 114 101 46

4

1 回答 1

2

这是因为第一个示例中的换行符被转换为空格。在这个线程中有更彻底的解释:防止浏览器将行之间的'\n'转换为空格(对于汉字)

于 2013-08-06T21:42:02.577 回答