본 사이트는 여러분의 사용자 경험을 개선하기 위해 유지 보수를 진행하는 동안 기능이 제한됩니다. 도움말로 문제가 해결되지 않고 질문을 하고 싶다면 Twitter의 @FirefoxSupport 및 Reddit의 /r/firefox 채널을 활용하세요.

Mozilla 도움말 검색

고객 지원 사기를 피하세요. 저희는 여러분께 절대로 전화를 걸거나 문자를 보내거나 개인 정보를 공유하도록 요청하지 않습니다. "악용 사례 신고"옵션을 사용하여 의심스러운 활동을 신고해 주세요.

자세히 살펴보기

IDENTICAL unordered lists, YET the displays are different.

  • 6 답장
  • 1 이 문제를 만남
  • 14 보기
  • 최종 답변자: cor-el

more options

Latest Firefox This HTML sequence contains two IDENTICAL unordered lists, YET the displays are different. As you can see, the 1st display list is double spaced and the 2nd display list is single spaced. Why?

<!DOCTYPE HTML>
<html>
<head><meta charset="utf-8"></head>
<body>

​<ul>
<li>The Federal.</li>
​<li>The Federal.</li>
​<li>The Federal.</li>
</ul>

---------------------

<ul>
<li>The Federal.</li>
<li>The Federal.</li>
<li>The Federal.</li>
</ul>

</body>
</html>

Displays:

   The Federal.
   ​
   The Federal.
   ​
   The Federal.

   The Federal.
   The Federal.
   The Federal.
Latest Firefox This HTML sequence contains two IDENTICAL unordered lists, YET the displays are different. As you can see, the 1st display list is double spaced and the 2nd display list is single spaced. Why? <pre><nowiki> <!DOCTYPE HTML> <html> <head><meta charset="utf-8"></head> <body> ​<ul> <li>The Federal.</li> ​<li>The Federal.</li> ​<li>The Federal.</li> </ul> --------------------- <ul> <li>The Federal.</li> <li>The Federal.</li> <li>The Federal.</li> </ul> </body> </html> </nowiki></pre><br> Displays: The Federal. ​ The Federal. ​ The Federal. --------------------- The Federal. The Federal. The Federal.

글쓴이 cor-el 수정일시

선택된 해결법

Those hidden spaces are present as red dots in the screenshot, so you can see that they are right before the <li> tags. I have no idea how/why they ended up in the first UL container as you would normally have to do some effort to get such Unicode characters in a document unless your editor has support. This is the first time I got across such special spaces. You can easily remove them by using cursor left starting with the LI tag until you notice that the cursor doesn't move because it passed the space and press the Delete key or use cursor right and backspace.

문맥에 따라 이 답변을 읽어주세요 👍 1

모든 댓글 (6)

more options

The source HTML I provided was interpreted: I meant to display the literal text HTML, so here's the HTML, but commented out so it would not be interpreted.

more options

If you inspect the code closely then you will notice that there are weird &amp#200b; zero-width-space characters present in your code that are rendered on a separate line.

&#0a;
&#200b;
&#3c;&#75;&#6c;&#3e;&#0a;
&#3c;&#6c;&#69;&#3e;&#54;&#68;&#65;&#20;
&#46;&#65;&#64;&#65;&#72;&#61;&#6c;&#2e;
&#3c;&#2f;&#6c;&#69;&#3e;&#0a;
&#200b;
&#3c;&#6c;&#69;&#3e;&#54;&#68;&#65;&#20;
&#46;&#65;&#64;&#65;&#72;&#61;&#6c;&#2e;
&#3c;&#2f;&#6c;&#69;&#3e;&#0a;
&#200b;
&#3c;&#6c;&#69;&#3e;&#54;&#68;&#65;&#20;
&#46;&#65;&#64;&#65;&#72;&#61;&#6c;&#2e;
&#3c;&#2f;&#6c;&#69;&#3e;&#0a;
&#3c;&#2f;&#75;&#6c;&#3e;

글쓴이 cor-el 수정일시

more options

Thank you for your response. OK, so the mystery BEGINS. Where did the zero-width-space get inserted? And why only in the 1st sequence and not the 2nd?

Is there a work-around?

BTW, how did you inspect the code to reveal the character encoding?

more options

선택된 해결법

Those hidden spaces are present as red dots in the screenshot, so you can see that they are right before the <li> tags. I have no idea how/why they ended up in the first UL container as you would normally have to do some effort to get such Unicode characters in a document unless your editor has support. This is the first time I got across such special spaces. You can easily remove them by using cursor left starting with the LI tag until you notice that the cursor doesn't move because it passed the space and press the Delete key or use cursor right and backspace.

more options

Thank you very much for you help. I finally understand what happened, but not why. Following the removal technique you described, I have a way to recognize the problem and work around it. Thanks again.