이 경우 인터넷 익스플로러는 적절한 여백을 제공하지 않습니다. 상자 위쪽에서 여백을 측정하고 패딩을 무시하는 것처럼 보입니다. 왜 이런거야? 좋은 해결 방법이 있습니까? 나는 IE7와 FF3에서 일하고 있어요패딩이있는 div 내에서 Internet Explorer 여백 문제가 발생했습니다.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<style type="text/css">
.messagebox
{
border: solid 2px black;
background: blue;
color: white;
padding: 10px; /* Problem only when padding set */
}
h1, h2, h3, h4
{
margin-top: 12px;
}
</style>
</head>
<body>
<div class="messagebox" style="width: 300px">
<h4 style="text-align: center">In IE, this text is 10px higher than in FF.</h4>
</div>
</body>
</html>
예를 들면 다음과 같습니다이다. 감사.
이 문제의 빠른 수정은 doctype을 HTML 4.01 strict로 변경하는 것입니다. –
링크를 제공해 주셔서 감사합니다. doctype 태그에 관해서는 HTML 4.01로 엄격하게 변경했지만 차이는 보이지 않습니다. –