2017-02-26 5 views
0

HTML emsp 엔터티의 동작에 대한 정확한 참조를 찾는 데 문제가 있습니다. W3.org, MDN, W3schools 및 여기를 살펴 보았습니다. 그러나 특수 스타일링이 적용되지 않은 HTML에서의 중단 또는 줄 바꿈 동작을 설명하는 설명을 아직 찾지 못했습니다.HTML emsp 엔터티 정확한 동작

아래 코드는 내가 사용했던 실험을 보여 주지만 랩핑 할시기와 그렇지 않을 때 혼란 스럽다. 좋은 참고가 있습니까?

<!DOCTYPE html> 
<html> 
<style> 
body { 
    font-size: 20px; font-family: Courier, fixed; 
} 
</style> 
<body> 

<p>Following is some text with some embedded emsp entities.<br>Here is one mid-word: sam&emsp;ple. <br>And here is one on each side of a dash: lock&emsp;-&emsp;step.<br>Then, how about one after a period?<br>Right after the next period is one and then a normal space.&emsp; How about the standard space and then the emsp?<br>That sequence follows this sample sentence. &emsp;(Note that since the regular space came first, this can cause this text after it to become indented, whereas the emsp-then-regular space occurrence just before will never do that, I think.) As long as I'm looking at them after the end of a sentence, we should try putting just one emsp after a sentence instead of the regular space caracter.<br>I thought that would stick the two sentences together, but it does not do so here.&emsp;Indeed, this is consistent with its behavior mid-word. Okay, how about multiple occurrences of it?<br>There are 3 in the brackets here: [&emsp;&emsp;&emsp;] and so on. I played with that last one a bit and I cannot get it to break after the 3 emsps. Here, they seem to keep their width (they are not combined into one) and they are not breakable, not even either before the first or after the last one. So, I seem to only be able to get the "[" and never the "]" as the first character on a new line.<br>Okay, more extremely, trying brackets around 5 emsp chars, a word, and 5 more emsp chars: [&emsp;&emsp;&emsp;&emsp;&emsp;word&emsp;&emsp;&emsp;&emsp;&emsp;] .<br>There we seem able to break before "word", but still never before "]". What's going on there? 
</p> 
<p>From the examples above, I think the mystery around emsp characters is mostly resolved for me.</p> 
<p>Consider the standard behavior for a regular space character. Here, first remember that multiple occurrences of regular whitespace characters are all compressed as if they were a single regular space character. Then, of course, the regular space character takes a certain width, and lines are never broken just before the regular space, only after it. And the space normally allocated for a regular space character does not need to be rendered at the right edge of a box.</p> 
<p>Similarly, text can break after an emsp character, but will not do so before. It is wider than a regular space character, but mostly behaves like it. Where it differs is if you have multiple emsp entities right next to each other. In that case, no break will occur before, within, or after the group (unless there is whitespace before or after it, in which case the whitespace is the location of the break). But if a set of multiple emsp characters are placed directly between two non-white characters (as in the bracket example above) then they are not compressed and no breaking occurs. That's all I'm thinking of at the moment ...</p> 

</body> 
</html> 
+0

누군가가 내 사례를 쉽게 볼 수있는 곳에 게시 할 수있는 좋은 방법을 알고 있다면 알려 주시면됩니다. –

답변

1

EMSP 나는, 나는 그것이 파괴 또는 비 분리 공백이 있는지 여부 http://opencoder.net/emsp.html

에 대한 간단한 설명을 발견

문자 "M"과 동일한 폭을 갖는 공백입니다 알아내는 가장 쉬운 방법은 테스트하는 것입니다.

+0

나는 내 수색에서 그 기사를 보았다. 단순히 다양한 공백 문자의 너비를 비교하지만 줄 바꿈 동작에 대해서는 아무 것도 말하지 않습니다. emsp에 관해서는 저자는 대부분 두 브라우저에서 렌더링되지 않았다고 말합니다. 버그는 지금까지 수정되었을 것입니다. –

+0

내 게시 된 코드를 보면 (미안하지만, 쉽게 읽을 수 있도록 게시하는 것이 더 좋은지 궁금합니다.) 실제로 Chrome 브라우저에서 실험 한 결과를 설명합니다. 줄 바꿈 동작에 대한 설명을 제공합니다. 그러나 그것은 많이 요구된다. 그래서 어딘가에 명확하고 간결한 참조가 있기를 바랍니다. 그렇지 않은 경우 여기에있는 누군가가 포장 동작을 명확하고 간결하며 정확하게 정의 할 것입니다. 위의 코드를 읽거나 시도 할 수 없다면 "때때로"를 제외하고 다른 공간처럼 감싸는 것처럼 보입니다. –