CSS 제어 텍스트 자동 줄 바꿈
자동 줄 바꿈 문제 일반 문자의 줄 바꿈은 더 합리적이지만 연속된 숫자와 영어 문자는 컨테이너를 확장하는 경우가 많으므로 CSS에서
메서드
div 및 p와 같은 블록 수준 요소의 경우 일반 텍스트 줄 바꿈(아시아 텍스트 및 비아시아 텍스트) 요소에는 기본 공백인 일반이 있으며 정의된 너비 다음에 자동으로 줄 바꿈됩니다.
#wrap{white- space :normal; width:200px; }
#wrap{word-break:break-all; width:200px;}
#wrap{word-wrap:break-word;}
경계를 초과하는 문자만 숨기거나 컨테이너에 스크롤 막대를 추가합니다
abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss |
효과: 중복된 콘텐츠 숨기기
2. (IE 브라우저) 테이블 레이아웃을 사용합니다. 테이블 너비를 강제로 조정하려면
abcdefghigklmnopqrstuvwxyz 1234567890 | abcdefghigklmnopqrstuvwxyz 1234567890 |
효과: 줄 바꿈 가능
3.(IE 브라우저) td에 div, p 등을 중첩하고 줄을 사용합니다. 위에서 언급한 div와 p의 래핑 방법
overflow:hidden;을 사용하여 초과된 내용을 숨기세요. 여기서는 Overflow:auto가 작동하지 않습니다.
abcdefghigklmnopqrstuvwxyz1234567890 |
효과: 내용 이상 숨기기
5. (Firefox 브라우저) td, th 등의 Nest div, p 등을 Firefox를 처리하려면 위에서 언급한 방법을 사용하십시오
실행 더 코드박스 100 머티리얼 네트워크<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>字符换行 </title> <style type="text/css"> table,td,th,div { border:1px green solid;} code { font-family:"Courier New", Courier, monospace;} </style> </head> <body> <h1 id="code-div-code"><code>div</code></h1> <h1 id="code-All-nbsp-white-space-normal-code"><code>All white-space:normal;</code></h1> <div style="white-space:normal; width:200px;">Wordwrap still occurs in a td element that has its WIDTH attribute set to a value smaller than the unwrapped content of the cell, even if the noWrap property is set to true. Therefore, the WIDTH attribute takes precedence over the noWrap property in this scenario</div> <h1 id="code-IE-nbsp-nbsp-word-wrap-nbsp-nbsp-break-word-nbsp-code"><code>IE word-wrap : break-word ;</code></h1> <div style="word-wrap : break-word ; width:200px;">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div> <h1 id="code-IE-nbsp-nbsp-word-break-break-all-code"><code>IE word-break:break-all;</code></h1> <div style="word-break:break-all;width:200px;">abcdefghijklmnabcdefghijklmnabcdefghijklmn111111111</div> <h1 id="code-Firefox-nbsp-word-break-break-all-nbsp-overflow-auto-code"><code>Firefox/ word-break:break-all; overflow:auto;</code></h1> <div style="word-break:break-all; width:200px; overflow:auto;">abcdefghijklmnabcdefghijklmnabcdefghijkl mn111111111</div> <h1 id="code-table-code"><code>table</code></h1> <h1 id="code-table-layout-fixed-code"><code>table-layout:fixed;</code></h1> <table style="table-layout:fixed" width="200"> <tr> <td>abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td> </tr> </table> <h1 id="code-table-layout-fixed-nbsp-word-break-nbsp-nbsp-break-all-nbsp-word-wrap-nbsp-nbsp-break-word-nbsp-code"><code>table-layout:fixed; word-break : break-all; word-wrap : break-word ;</code></h1> <table width="200" style="table-layout:fixed;"> <tr> <td width="25%" style="word-break : break-all; ">abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td> <td style="word-wrap : break-word ;">abcdefghigklmnopqrstuvwxyz1234567890ssssssssssssss</td> </tr> </table> <h1 id="code-FF-nbsp-nbsp-table-layout-fixed-nbsp-overflow-hidden-code"><code>FF table-layout:fixed; overflow:hidden;</code></h1> <table style="table-layout:fixed" width="200"> <tr> <td width="25%" style="word-break : break-all; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td> <td width="75%" style="word-wrap : break-word; overflow:hidden; ">abcdefghigklmnopqrstuvwxyz1234567890</td> </tr> </table> </body> </html>
궁금한 점이 있으시면 아래에 메시지를 남겨주세요

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











Svelte Transition API는 맞춤형 전환을 포함하여 문서를 입력하거나 떠날 때 구성 요소를 애니메이션하는 방법을 제공합니다.

웹 사이트의 컨텐츠 프레젠테이션을 설계하는 데 얼마나 많은 시간을 소비합니까? 새 블로그 게시물을 작성하거나 새 페이지를 만들 때

최근 Bitcoin의 가격이 20k 달러가 넘는 USD가 최근에 등반되면서 최근 30k를 끊었으므로 Ethereum을 만드는 데 깊이 다이빙을 할 가치가 있다고 생각했습니다.

이 기사에서는 그림자 및 그라디언트와 같은 텍스트 효과에 CSS를 사용하여 성능을 최적화하고 사용자 경험을 향상시킵니다. 초보자를위한 리소스도 나열됩니다. (159 자)

NPM 명령은 서버 시작 또는 컴파일 코드와 같은 것들에 대한 일회성 또는 지속적으로 실행되는 프로세스로 다양한 작업을 실행합니다.

개발자로서 어느 단계에 있든, 우리가 완료 한 작업은 크든 작든, 개인적이고 전문적인 성장에 큰 영향을 미칩니다.

나는 다른 날에 Eric Meyer와 대화를 나누고 있었고 나는 내 형성 시절부터 Eric Meyer 이야기를 기억했습니다. CSS 특이성에 대한 블로그 게시물을 썼습니다
