CSS white-space 속성은 요소가 공백 문자를 처리하는 법을 지정합니다. /* Keyword values */
white-space: normal;
white-space: nowrap;
white-space: pre;
white-space: pre-wrap;
white-space: pre-line;
white-space: break-spaces;
/* Global values */
white-space: inherit;
white-space: initial;
white-space: unset;
white-space 속성은 다음 목록의 키워드 값 중 하나를 사용해 설정합니다. 값normal 연속 공백을 하나로 합침. 개행 문자도 다른 공백 문자와 동일하게 처리합니다. 한 줄이 너무 길어서 넘칠 경우 자동으로 줄을 바꿉니다. nowrap연속 공백을 하나로 합침. 줄 바꿈은 <br> 요소에서만 일어납니다. pre연속 공백 유지. 줄 바꿈은 개행 문자와 <br> 요소에서만 일어납니다. pre-wrap연속 공백 유지. 줄 바꿈은 개행 문자와 <br> 요소에서 일어나며, 한 줄이 너무 길어서 넘칠 경우 자동으로 줄을 바꿉니다. 연속 공백을 하나로 합침. 줄바꿈은 개행 문자와 <br> 요소에서 일어나며, 한 줄이 너무 길어서 넘칠 경우 자동으로 줄을 바꿉니다. break-spaces다음 차이점을 제외하면 pre-wrap과 동일합니다.
다음은 여러가지 white-space 값의 동작을 정리한 표입니다. 형식 구문white-space = 예제기본 예제code { white-space: pre; } <pre> 요소 내부의 줄 바꿈pre { word-wrap: break-word; /* IE 5.5-7 */ white-space: pre-wrap; /* current browsers */ } 실제로 보기<div id="css-code" class="box"> p { white-space: <select> <option>normal</option> <option>nowrap</option> <option>pre</option> <option>pre-wrap</option> <option>pre-line</option> <option>break-spaces</option> </select> } </div> <div id="results" class="box"> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> .box { width: 300px; padding: 16px; border-radius: 10px; } #css-code { background-color: rgb(220,220,220); font-size: 16px; } #results { background-color: rgb(230,230,230); overflow-x: scroll; height: 400px; white-space: normal; font-size: 14px; } var select = document.querySelector("#css-code select"); var results = document.querySelector("#results p"); select.addEventListener("change", function(e) { results.setAttribute("style", "white-space: "+e.target.value); }) HTML<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> CSS + 결과명세
브라우저 호환성BCD tables only load in the browser 같이 보기
When deciding how much white space to leave on a page it is important to consider that?too much white space makes the text look sparse. too little white space makes the text look cluttered. conveying a message that is easy to read. use one type of formatting at a time.
Which of the following are good principles for determining the amount of information to include in a business communication choose every correct answer?Which of the following are good principles for determining the amount of information to include in a business communication? -Too much information is distracting and makes the message harder to comprehend.
What is the main purpose of navigational design?Navigation design is the discipline of creating, analyzing and implementing ways for users to navigate through a website or app. Navigation plays an integral role in how users interact with and use your products. It is how your user can get from point A to point B and even point C in the least frustrating way possible.
Which of the following were found to be true in a study by the American Press Institute concerning?Which of the following were found to be true in a study by the American Press Institute concerning reader comprehension? For sentences longer than 20 words, comprehension fell to 80% or less comprehension. The sentences that people understood most easily had no more than 10 words.
|