웹표준,웹접근성(html, html5, css, css3, javascript, jQuery, jQueryMobile, snecha, senchaTouch, php, mobileWebApp)

word-wrap 본문

css3

word-wrap

jokack01 2013. 10. 8. 09:30

word-wrap

기존에는 영어 띄어 쓰기를 하지 않는 경우 박스 밖으로 밀려나는 것을 볼 수 있다. Css3에서는 word-wrap기능으로 박스의 폭에 맞추어 넣을 수 있게 되었다.  

 

  • Break-word :  해당 영역에 넓이 값을 벗어 날 경우 자동으로 줄 바꿈 해준다.

 

ex) 자동 줄바꿈

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>word-wrap</title>
<style type="text/css">
p{
width:11em;
border:1px solid #000000;
background:yellow;
}
p.test{
width:11em;
border:1px solid #000000;
word-wrap:break-word;
background:yellow;
}
</style>
</head>
<body>
<h1>word-wrap</h1>
<h3>css2 기준</h3>
<p>
TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest
TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest
TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest
</p>
<h3>css3</h3>
<p class="test">
TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest
TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest
TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest
</p>
</body>
</html>

'css3' 카테고리의 다른 글

2D transform  (0) 2013.10.08
font-face  (0) 2013.10.08
text-shadow  (0) 2013.10.08
background  (1) 2013.10.02
box-shadow  (0) 2013.10.02