Home 게시판 커뮤니티 Q&A word-wrap 에 관한 내용같은데 설명해 주실 분 있으신가요?

8개 답변, 2 voices Last updated by Avatar of toorntoorn 16 years, 10 months 전
  • Avatar of toorntoorn
    Participant
    @toorn
    #2733

    질문하셨던 첫 글에 걸린 링크에 보면 그 댓글 중에 { overflow:auto; }에 관한 것이 있어서 잠깐 찾아봤습니다. 코드를 포스트에 표현할 때,

    <code { overflow:auto; }> 코드 내용 </code>

    로 표현하니까 코드의 아래에 스크롤바가 나타나면서, 본문 폭에 맞춰서 표현 되더군요.

    Avatar of toorntoorn
    Participant
    @toorn
    #2734

    http://weblogtoolscollection.com/archives/2007/06/16/css-for-code-wrap-long-lines/
    여기에 긴줄 넘김에 대한 정보가 있는 것 같은데 솔직히 무슨 말인지 잘 모르겠네요.
    혹시 설명해 주실 분 있으신가요?

    If you post code on your WordPress blog, you could use a code beautifier plugin such as syntax highlighter or you could include your code in <pre> tags. They preserve line breaks, multiple blanks, tabs between words and other formatting commonly used in code. However, in some cases, if body of your blog is narrow(er) or your line of code is really long, it will not wrap and will overflow over your sidebar. You can just hide the overflow but that still will look tacky and not very usable. On performing a little search, I discovered that Tyler Longren had already come up with a clever hack to solve the problem. If you add the following code to your stylesheet, it will wrap the long lines of code.

    pre {

    white-space: pre-wrap; /* css-3 */

    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */

    white-space: -pre-wrap; /* Opera 4-6 */

    white-space: -o-pre-wrap; /* Opera 7 */

    word-wrap: break-word; /* Internet Explorer 5.5+ */

    }

    Avatar of toorntoorn
    Participant
    @toorn
    #2738

    http://weblogtoolscollection.com/archives/2007/06/16/css-for-code-wrap-long-lines/
    여기에 긴줄 넘김에 대한 정보가 있는 것 같은데 솔직히 무슨 말인지 잘 모르겠네요.
    혹시 설명해 주실 분 있으신가요?

    If you post code on your WordPress blog, you could use a code beautifier plugin such as syntax highlighter or you could include your code in <pre> tags. They preserve line breaks, multiple blanks, tabs between words and other formatting commonly used in code. However, in some cases, if body of your blog is narrow(er) or your line of code is really long, it will not wrap and will overflow over your sidebar. You can just hide the overflow but that still will look tacky and not very usable. On performing a little search, I discovered that Tyler Longren had already come up with a clever hack to solve the problem. If you add the following code to your stylesheet, it will wrap the long lines of code.

    pre {

    white-space: pre-wrap; /* css-3 */

    white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */

    white-space: -pre-wrap; /* Opera 4-6 */

    white-space: -o-pre-wrap; /* Opera 7 */

    word-wrap: break-word; /* Internet Explorer 5.5+ */

    }

    Avatar of suineg11suineg11
    Participant
    @suineg11
    #2735

    저는 css 대해 아는 바가 없어서 간단히 번역 내용만 쓸께요.

    워프 포스트에서 코드를 쓰려면, syntax highlighter 같은 플러그인이나 pre 태그를 쓰면 됩니다. 허나 문제는, 블로그의 포스트 폭이 짧거나 쓰고자 하는 코드가 너무 길면, 코드가 포스트란을 벗어나 사이드바에 까지 넘어간다는 것이 문제입니다. Tyler Longren이 이 문제를 이미 해결했는데, 그 방법은 아래의 코드를 stylesheet에 포함 시키면, 긴 줄의 코드도 감쌉니다.

    [/quote]

    Avatar of suineg11suineg11
    Participant
    @suineg11
    #2739

    저는 css 대해 아는 바가 없어서 간단히 번역 내용만 쓸께요.

    워프 포스트에서 코드를 쓰려면, syntax highlighter 같은 플러그인이나 pre 태그를 쓰면 됩니다. 허나 문제는, 블로그의 포스트 폭이 짧거나 쓰고자 하는 코드가 너무 길면, 코드가 포스트란을 벗어나 사이드바에 까지 넘어간다는 것이 문제입니다. Tyler Longren이 이 문제를 이미 해결했는데, 그 방법은 아래의 코드를 stylesheet에 포함 시키면, 긴 줄의 코드도 감쌉니다.

    [/quote]

    Avatar of toorntoorn
    Participant
    @toorn
    #2736

    친절한 답변감사합니다. 헌데 위 설명대로 사타일시트에 붙여서 해봤는데 제대로 작동되지는 않는군요.

    Avatar of toorntoorn
    Participant
    @toorn
    #2740

    친절한 답변감사합니다. 헌데 위 설명대로 사타일시트에 붙여서 해봤는데 제대로 작동되지는 않는군요.

    Avatar of toorntoorn
    Participant
    @toorn
    #2737

    suineg11 Escribi

    Avatar of toorntoorn
    Participant
    @toorn
    #2741

    suineg11 Escribi

9 글 보임 - 1에서 9 까지 (총 9 중에서)
  • 답변은 로그인 후 가능합니다.