문제

XUL 응용 프로그램에서 긴 줄이 포함되어 있어도 랩핑하기 위해 설명을 얻으려고합니다.

예를 들어 다음을 .xul 파일로 저장하고 Firefox로 열면 괜찮아 보이고 적절하게 랩합니다.

<?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window
    id="theWindow"
    title="The Window"
    style="overflow: auto;"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:html="http://www.w3.org/1999/xhtml"
    >


  <vbox flex="1" style="max-width: 200px; overflow:auto; border: 1px dotted black; padding: 2px;">
    <description style="border: 1px solid black; padding: 2px;">test</description>
    <description style="border: 1px solid black; padding: 2px;">test test test test test test test test test test test test test test test test test test test test test</description>
  </vbox>
</window>

그러나 큰 선에서 공간을 제거하면 포장되지 않고 스크롤 막대가 표시됩니다.

<?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <window
    id="theWindow"
    title="The Window"
    style="overflow: auto;"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    xmlns:html="http://www.w3.org/1999/xhtml"
    >


  <vbox flex="1" style="max-width: 200px; overflow:auto; border: 1px dotted black; padding: 2px;">
    <description style="border: 1px solid black; padding: 2px;">test</description>
    <description style="border: 1px solid black; padding: 2px;">testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest</description>
  </vbox>
</window>

CSS 또는 다른 것을 사용하여 200 픽셀 한계에 도달 할 때 긴 줄을 감싸도록 강제로 할 수있는 방법이 있습니까?

도움이 되었습니까?

해결책

Firefox 3.1은 다음을 지원합니다. http://www.css3.info/preview/word-wrap/

Word-Wrap 속성은 Microsoft에 의해 발명되어 CSS3에 추가되었습니다. 긴 단어가 깨질 수 있고 다음 줄로 감을 수 있습니다. 그것은 두 가지 값으로 필요합니다. 정상 또는 브레이크 단어. 이것은 현재 IE, Safari 및 Firefox 3.1 (알파)에서 지원됩니다.

이전 (및 현재) 버전의 Firefox에서는 표준 방법이 없습니다 (Google은 내 친구)가 없습니다. 일부는 추가하는 작은 스크립트를 사용하는 것이 좋습니다 <br /> 단어의 중간에. 사용 Word-Wrap : 브레이크 워드 그리고 사용자가 결국 업그레이드되기를 바랍니다.

다른 팁

원래 Chatzilla는 비어 있었다u003Cimg> 출력에 대한 요소는 긴 단어가 랩을 할 수있는 지점으로 작용하지만 나중에 요소로 변경되었습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top