๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Lect & Tip/html, css, scss

โœˆ CSS ํ…์ŠคํŠธ ์†์„ฑ : text-align:justify,text-justify:auto,inter-word,inter-ideograph,inter-cluster,distribute,kashida,newspaper,distribute-all-lines,distribute-center-last

by ๋‚ฏ์„ ๊ณต๊ฐ„2019 2020. 9. 15.

๋ชฉ์ฐจ

    2014๋…„์— ์ž‘์„ฑํ–ˆ๋˜ ๊ธ€์ž…๋‹ˆ๋‹ค. ๋ธ”๋กœ๊ทธ๋ฅผ ์˜ฎ๊ธฐ๋Š” ์ค‘์ด๋ผ... ์ฟจ๋Ÿญ

    text-align:justify; text-justify:~ ์†์„ฑ์€ ๊ณจ ๋•Œ๋ฆฌ๊ฒŒ๋„ CSS2์—๋Š” ํฌํ•จ๋˜์ง€ ์•Š๊ณ , CSS3์—๋Š” ํฌํ•จ์ด ๋˜์–ด ์žˆ๊ณ , IE ๊ตฌ๋ฒ„์ „๋“ค์€ ์ผ๋ถ€ ์ง€์›์„ ํ•˜๊ณ , 9 ์ด์ƒ์—์„œ๋Š” ์ง€์›์ด ๋˜์ง€ ์•Š๋Š” ์›ƒ๊ธด ์–‘์ƒ์„ ๋ณด์ด๋Š” ํ…์ŠคํŠธ ์†์„ฑ์ด๋‹ค.

    ๋” ๊ท€์ฐฎ์€ ๊ฒƒ์€ ๊ณจ ๋•Œ๋ฆฌ๊ฒŒ๋„, ์ด ์†์„ฑ์„ ๊ณต๋ฌด์›๋‹˜๋“ค์ด ๋„ˆ๋ฌด ์ข‹์•„๋ผ ํ•˜์‹ ๋‹ค๋Š” ๊ฑฐ๋‹ค. -_-; 

    ๊ตฐ์ •์‹œ๋Œ€ ์Šต์„ฑ๋“ค์ด ๋‚จ์•„ ๊ณ„์‹  ๊ฑด์ง€ ๊ธ€์”จ๋“ค์ด ๊ฐ ๋งž์ถฐ์„œ ์—ด ๋งž์ถฐ์„œ ์„œ ์žˆ๊ธฐ๋ฅผ ๋ฐ”๋ผ๋Š” ๋ถ„๋“ค์ด ๊ฐ„ํ˜น ์žˆ๋‹ค. 

    ๊ทธ๋Ÿฌ๋ฉด์„œ ๋‹จ์–ด๋Š” ์Œ์ ˆ๋‹จ์œ„์—์„œ ๊ฐœํ–‰ํ•˜์ง€ ์•Š๊ฒŒ ํ•ด ๋‹ฌ๋ž€๋‹ค. 

    ์•„ํ•˜~

    ๋‚˜์ฒ˜๋Ÿผ ์ด๋Ÿฐ ๊ฐˆ๊ตผ์„ ๋‹นํ•˜๋Š” ํผ๋ธ”๋ฆฌ์…”๋“ค์ด ๋งŽ์œผ์‹ ์ง€, ์˜์™ธ๋กœ ๊ฒ€์ƒ‰ ์œ ์ž…์— text-align:justify๋ฅผ ๊ฒ€์ƒ‰ํ•˜๋Š” ์‚ฌ๋žŒ๋“ค์ด ๊ฝค ์žˆ๋‹ค. 

    ๊ทธ๋ถ„๋“ค์˜ ๊ฐˆ์ฆ์„ ํ•ด์†Œํ•ด๋“œ๋ฆฌ๊ณ ์ž, ๋ธŒ๋ผ์šฐ์ €๋ณ„๋กœ ์†์„ฑ ๊ฐ’์ด ์–ด๋–ป๊ฒŒ ์ ์šฉ๋˜๋Š”์ง€๋ฅผ ์ผ์ผ์ด ๋ธŒ๋ผ์šฐ์ €๋งˆ๋‹ค ๋Œ๋ ค์„œ ์บก์ฒ˜ ๋– ์„œ ํ•œ ์ด๋ฏธ์ง€๋กœ ๋งŒ๋“ค์–ด ๋‘์—ˆ๋‹ค.

    ๊ฒฐ๋ก ๋ถ€ํ„ฐ ๋งํ•˜์ž๋ฉด, IE6~8๊นŒ์ง€๋งŒ ์ ์šฉ๋˜๊ณ , ๋‚˜๋จธ์ง€ ๋ชจ๋“  ๋ธŒ๋ผ์šฐ์ €์—์„œ๋Š” ์•ˆ๋œ๋‹ค.

    IE8์—์„œ๋Š” ๋ชจ๋“  ์†์„ฑ์ด ๋‹ค ์•ˆ ๋จน๊ณ  ์œ ์ผํ•˜๊ฒŒ distribute-all-lines ๋งŒ ์ ์šฉ๋œ๋‹ค. 

    ์ด๋งˆ์ €๋„ 9์—์„œ๋Š” ์ ์šฉ๋˜์ง€ ์•Š๋Š”๋‹ค.

    IE6,7์—์„œ๋Š” inter-cluster, kashida, newspaper, distribute-all-lines ๋งŒ ์ ์šฉ๋œ๋‹ค.

    text-align:jusitify์˜ ์ทจ์ง€๋Š” ์—ฌ๋Ÿฌ ์ค„์ด ๋„˜์–ด๊ฐˆ ๋•Œ ๋งŒ ์–‘์ชฝ ์ •๋ ฌ์„ ํ•œ๋‹ค. 

    ํ•œ ์ค„์ด ์™„์ „ํžˆ ๋‹ค ์ฐจ์ง€ ์•Š์€ ๊ฒฝ์šฐ์—๋Š” ์–‘์ชฝ ์ •๋ ฌ์„ ํ•˜์ง€ ์•Š์œผ๋ฉฐ, ํ•œ ์ค„์ด ๋‹ค ์ฐจ์ง€ ์•Š์•„๋„ ์–‘์ชฝ ์ •๋ ฌ์„ ํ•˜๊ณ ์ž ํ•  ๋•Œ์—๋Š” distribute-all-lines์„ ์ ์šฉํ•œ๋‹ค.

     

    <style>
    
    .text-01 { width:304px; border:2px solid #06F; padding:10px;font-size:14px; text-align:justify;text-justify:auto;}
    
    .text-02 { width:304px; border:2px solid #077817; padding:10px; font-size:14px; text-align:justify;text-justify:inter-word;}
    
    .text-03 { width:304px; border:2px solid #603; padding:10px; font-size:14px; text-align:justify;text-justify:inter-ideograph;}
    
    .text-04 { width:304px; border:2px solid #CC0; padding:10px; font-size:14px; text-align:justify;text-justify:inter-cluster;}
    
    .text-05 { width:304px; border:2px solid #F99; padding:10px; font-size:14px; text-align:justify;text-justify:distribute;}
    
    .text-06 { width:304px; border:2px solid #ff3333; padding:10px; font-size:14px; text-align:justify;text-justify:kashida;}
    
    .text-07 { width:304px; border:2px solid #AA0004; padding:10px; font-size:14px; text-align:justify;text-justify:newspaper}
    
    .text-08 { width:304px; border:2px solid #AA0004; padding:10px; font-size:14px; text-align:justify;text-justify:distribute-all-lines}
    
    .text-09 { width:304px; border:2px solid #AA0004; padding:10px; font-size:14px; text-align:justify;text-justify:distribute-center-last}
    
    </style>

       

    <div class="text-01"> 
    
    <p>text-justify:auto;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .</p>
    
    </div>
    
    <div class="text-02">
    
    <p> text-justify:inter-word;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>
    
    <div class="text-03">
    
    <p> text-justify:inter-ideograph;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>
    
    <div class="text-04">
    
    <p> text-justify:inter-cluster;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>
    
    <div class="text-05">
    
    <p> text-justify:distribute;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>
    
    <div class="text-06">
    
    <p> text-justify:kashida;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>
    
    <div class="text-07">
    
    <p> text-justify:newspaper;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>
    
    <div class="text-08">
    
    <p> text-justify:distribute-all-lines;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>
    
    <div class="text-09">
    
    <p> text-justify:distribute-center-last;<br />I don't even try to control you. Look into my eyes and I'll own you. 
    
    <br />I've got the moves like jagger.<br />I've got the moves like jagger.</p>
    
    <p> ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ . <br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .<br /> ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ . </p>
    
    </div>

     

    text-justify:auto;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:inter-word;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:inter-ideograph;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:inter-cluster;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:distribute;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:kashida;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:newspaper;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:distribute-all-lines;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    text-justify:distribute-center-last;
    I don't even try to control you. Look into my eyes and I'll own you.
    I've got the moves like jagger.
    I've got the moves like jagger.

    ๋‚œ ๋„ˆ๋ฅผ ํ†ต์ œํ•˜๋ ค๊ณ  ์กฐ์ฐจ ์•ˆํ•˜๋Š”๋ฐ . ๋‚˜์˜๋ˆˆ์„ ๋ด , ๊ทธ๋Ÿผ ๋‚œ ๋„ ๊ฐ–๊ฒŒ๋˜์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .
    ๋‚œ Jagger ์™€ ๊ฐ™์ด ์›€์ง์ด์ง€ .

    ๋ฐ˜์‘ํ˜•

    ๋Œ“๊ธ€