Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

줄을 끊고 CSS로 다음 줄로 줄바꿈

<시간/>

word-wrap 속성을 사용하여 줄을 끊고 다음 줄로 줄 바꿈하십시오. CSS에서 줄 바꿈 속성을 구현하기 위해 다음 코드를 실행할 수 있습니다.

예시

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 200px;
            border: 2px solid #000000;
         }
         div.b {
            word-wrap: break-word;
         }
      </style>
   </head>
   <body>
      <h2>word-wrap: break-word property</h2>
      <div class = "b"> ThisisdemotextThisisdemotext:
      thisisaveryveryveryveryveryverylongword.
      The long word wraps to the next line.</div>
   </body>
</html>

출력

줄을 끊고 CSS로 다음 줄로 줄바꿈