답변 4개
채택된 답변
+20 포인트
답변에 대한 댓글 3개
�
코딩초보1
6년 전
�
코딩초보1
6년 전
크롬에서는 top: 130px;
해야지만 위치가 맞구요
익스에서는 top:85px;
위치가 맞아요 ㅠ
해야지만 위치가 맞구요
익스에서는 top:85px;
위치가 맞아요 ㅠ
�
평정심
6년 전
다음 처럼 자바스크립트를 사용하니 얼추 맞는 것 같습니다. 참조하시죠.
<div id="testBox" style="position:absolute;top:150px;width:200px;height:100px;background-color:blue"></div>
<script>
$(function() {
var agent = navigator.userAgent.toLowerCase();
if (agent.indexOf("msie") > -1 || agent.indexOf("trident") > -1) {
$("#testBox").css({
'position' : 'absolute',
'top' : '150px'
});
}
});
</script>
<div id="testBox" style="position:absolute;top:150px;width:200px;height:100px;background-color:blue"></div>
<script>
$(function() {
var agent = navigator.userAgent.toLowerCase();
if (agent.indexOf("msie") > -1 || agent.indexOf("trident") > -1) {
$("#testBox").css({
'position' : 'absolute',
'top' : '150px'
});
}
});
</script>
댓글을 작성하려면 로그인이 필요합니다.
6년 전
IE에서 top이 제대로 동작하지 않는걸로 알고 있습니다. margin-top이나 padding-top 등의 속성을 사용하셔서 해야 할듯 합니다
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
또 익스에서는 맞는데 크롬에서는 위치가 다르게나옵니다 ㅜㅠ