๐Ÿ•ธ๋ธŒ๋ผ์šฐ์ €๋ณ„ CSS ๋ณ„๋„ ์ ์šฉํ•˜๊ธฐ

๋ธŒ๋ผ์šฐ์ €๋ณ„ HTML์—์„œ CSS ๋‹ค๋ฅด๊ฒŒ ์ ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ์ง„ํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•

HTML ์ฝ”๋“œ์—์„œ CSS๋ฅผ ๋ธŒ๋ผ์šฐ์ € ๋ณ„๋กœ ๋‹ค๋ฅด๊ฒŒ ์ ์šฉํ•ด์•ผํ•˜๋Š” ์ƒํ™ฉ์€ ๋ถ„๋ช…ํžˆ ๋ฐœ์ƒํ•œ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, Chrome, Safari์—์„œ ๊ฐ™์€ CSS๋ผ๋„ ์–ด๋””์—์„œ๋Š” ๋ฉ€์ฉกํ•˜๊ฒŒ ์ ์šฉ๋˜๋Š” ๊ฒƒ ๊ฐ™์•„๋„, ๋‹ค๋ฅธ ๊ณณ์—์„œ๋Š” ์ ์šฉ ์•ˆ๋˜๋Š” ๊ฒฝ์šฐ๋“ค์ด๋‹ค.

์ด ๊ฒฝ์šฐ, ํ•ด๊ฒฐ์ฑ…์€ ๋ช…ํ™•ํ•˜๋‹ค. ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ•ด๋ณด์ž.

<script type="text/javascript">
if( (navigator.userAgent).indexOf("Chrome") > -1   //Chrome, ์•ˆ๋“œ๋กœ์ด๋“œ ํฐ, Edge๊ฐ€ ํ•ด๋‹น๋ฉ๋‹ˆ๋‹ค.
            || (navigator.userAgent).indexOf("rv:") > -1   //์ต์Šคํ”Œ๋กœ๋Ÿฌ๋งŒ ํ•ด๋‹น๋ฉ๋‹ˆ๋‹ค
            ){
            document.write('<link href="for_Chrome_IE.css" rel="stylesheet" />');
        }else{
            document.write('<link href="for_Safari.css" rel="stylesheet" />');   //์•„์ดํฐ, ์‚ฌํŒŒ๋ฆฌ๊ฐ€ ํ•ด๋‹น
        }
</script>

<script> ํƒœ๊ทธ๋งŒ ์‚ฌ์šฉ ์•ˆํ•˜๋ฉด ํ”„๋ก ํŠธ์—”๋“œ์—์„œ๋„ ๋ธŒ๋ผ์šฐ์ €๋ณ„๋กœ ๋‹ค๋ฅด๊ฒŒ CSS ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ๊ฐ€๋Šฅํ•˜๋‹ค.

Chrome ๋˜๋Š” Explorer ์ผ ๊ฒฝ์šฐ์™€ ๊ทธ ์™ธ์˜ ๋ธŒ๋ผ์šฐ์ €์˜ ๊ฒฝ์šฐ๋กœ ๋‚˜๋ˆ ์„œ CSS ํƒœ๊ทธ๋ฅผ ์ถ”๊ฐ€ํ•˜์ž.

์ž˜ ๋ชจ๋ฅด๋‹ˆ ์‚ฝ์งˆํ•˜๋Š” ์ƒํ™ฉ์€ ๋ถ„๋ช…ํžˆ ๋ฐœ์ƒํ•˜๋Š”๋ฐ, ๋‚˜๋ณด๋‹ค ์•ž์„œ ์‚ฝ์งˆํ•œ ์‚ฌ๋žŒ๋“ค์€ ํ•ญ์ƒ ์žˆ๋Š” ๊ฒƒ ๊ฐ™๋‹ค.

๋‚ด์‹ค์ด ๋‹จ๋‹จํ•œ ๊ฐœ๋ฐœ์ž๋กœ์„œ ๊พธ์ค€ํžˆ ์„ฑ์žฅํ•ด๋‚˜๊ฐ€์ž.

Last updated