ie6, ie8 과 파이어폭스에서 css width값 동일하게 맞추기 정보
기타 ie6, ie8 과 파이어폭스에서 css width값 동일하게 맞추기본문
table을 대체하여 css로 박스를 만들때 width값이 잘 맞지 않아서 화면이 깨지는 현상이 있는경우 사용..
익스플로어와 파이어폭스에서 넓이(width)값 계산방식이 틀려서인데 아래의 형태로 핵을 추가하면
위 브라우저에서는 모두 동일하게 화면이 깨지지 않고 표시됨.
익스6, 익스8, 파이어폭스에서 css 로 테이블 박스를 만들어 width값을 넣었을때 깨지는 경우,
아래 방법으로 핵을 사용하면 정확하게 맞아 떨어집니다
익스플로어와 파이어폭스에서 넓이(width)값 계산방식이 틀려서인데 아래의 형태로 핵을 추가하면
위 브라우저에서는 모두 동일하게 화면이 깨지지 않고 표시됨.
익스6, 익스8, 파이어폭스에서 css 로 테이블 박스를 만들어 width값을 넣었을때 깨지는 경우,
아래 방법으로 핵을 사용하면 정확하게 맞아 떨어집니다
아래 댓글 참고.
[이 게시물은 관리자님에 의해 2011-10-31 16:54:41 CSS에서 이동 됨]
추천
1
1
댓글 2개
<style type="text/css">
#wrap {width:1040px; margin:0; padding:0px;}
#navi {height:60px; margin:0; padding:0; background-color:#f1f1f1;}
#navi_left {
float:left;
padding:0;
overflow:hidden;
width:208px; height:30px;
border:1px solid #333;
/*\**/:width:210px; /* ie용 핵 */
}
#navi_center {
float:left;
padding:0;
overflow:hidden;
width:618px; height:30px;
border:1px solid #333;
/*\**/:width:620px; /* ie용 핵 */
}
#navi_right {
float:right;
padding:0;
overflow:hidden;
width:208px; height:30px;
border:1px solid #333;
/*\**/:width:210px; /* ie용 핵 */
}
</style>
<div id="wrap">
<div id="navi">
<div id="navi_left">좌측공간</div>
<div id="navi_center">중앙-contents</div>
<div id="navi_right">우측공간</div>
</div>
</div>
</body>
</html>
#wrap {width:1040px; margin:0; padding:0px;}
#navi {height:60px; margin:0; padding:0; background-color:#f1f1f1;}
#navi_left {
float:left;
padding:0;
overflow:hidden;
width:208px; height:30px;
border:1px solid #333;
/*\**/:width:210px; /* ie용 핵 */
}
#navi_center {
float:left;
padding:0;
overflow:hidden;
width:618px; height:30px;
border:1px solid #333;
/*\**/:width:620px; /* ie용 핵 */
}
#navi_right {
float:right;
padding:0;
overflow:hidden;
width:208px; height:30px;
border:1px solid #333;
/*\**/:width:210px; /* ie용 핵 */
}
</style>
<div id="wrap">
<div id="navi">
<div id="navi_left">좌측공간</div>
<div id="navi_center">중앙-contents</div>
<div id="navi_right">우측공간</div>
</div>
</div>
</body>
</html>
dtd xhtml 선언후 <meta http-equiv="X-UA-Compatible" content="IE=edge" />
메타 선언하면 똑같이 그나마 똑같이 먹음. 하지만 조금씩은 틀리다는거;;
메타 선언하면 똑같이 그나마 똑같이 먹음. 하지만 조금씩은 틀리다는거;;