오늘 나는 이상한 점을 발견하여 상대 위치 지정을 사용하여 텍스트를 이미지로 이동시키는 빠른 "건설 중"유형 페이지를 작성했습니다. 상대적 위치 DIV 될하는 데 사용되는 영역은 여전히 공간을 차지 것을CSS 상대 위치 지정으로 괴상한 문제가 발생했습니다.
<html>
<head>
<title>Bronco Marching Band</title>
</head>
<body style="background-color: #888;">
<div style="text-align: center;">
<img src="standby.jpg" width="799px" height="600px" alt="Please Stand By"
title="The Bronco Band website is down for a major upgrade. Please check back later."
style="width: 620px; height: 465px; opacity: 0.8;" />
<div style="color: #C69C6D; font-size: 397%; font-weight: bold; font-family: sans, arial, helvetica; position: relative; top: -300px; left: 0px;">
PLEASE STAND BY
</div>
</div>
</body>
</html>
것 같다 (당신이 관심이 있다면이 페이지는 SO의 오프라인 페이지에 의해 "영감"이었다). 즉, 위치가 지정되지 않으면 div가있는 이미지 아래에 공백이 남습니다.
이 문제가 발생합니까? 이것보다
가 : 당신의 코드 네 자리를 들여, 그것을 포스트 또는 미리보기에서 렌더링되지 않습니다. – Shog9