안녕하세요 저는 절대 위치에 divs를 그려서 dreamweaver 사이트를 만들었지 만 1280px 와이드 모니터를 중심으로 보였으므로 상위 #wrap div를 호스트로 만들 수없는 것처럼 보입니다. 모든 절대 위치 div. 여기 Absolute positions divs로 만든 완전한 웹 사이트 센터링
여기<style type="text/css">
#wrap_main {
position: absolute;
top: 0px;
z-index: 2;
width:1400px;
margin-left:-200px;
left:50%;
text-aling:left;
}
body {
background-color: #000000;
}
#Layer1 {
position:relative;
left:34px;
top:32px;
width:156px;
height:102px;
z-index:1;
}
#Layer2 {
position:relative;
left:37px;
top:136px;
width:104px;
height:32px;
z-index:2;
}
#Layer3 {
position:relative;
left:140px;
top:136px;
width:104px;
height:33px;
z-index:3;
}
내 부모 DIV와 내가 포장하고자하는 서브 DIV ID를 보여주는 HTML 콘텐츠입니다, 내가 만든 코드입니다.
<div id="wrap_main">
<div id="Layer25"></div>
<div id="Layer37">`<img src="../Beer_n_tts_website/Images/blue_wood.jpg" alt="Blue Wood" width="200" height="634" longdesc="Blue wood background for beer n tts" /></div>
<div id="Layer38"><a href="../Beer_n_tts_website/index.html"><img src="../Beer_n_tts_website/Images/beerntts_logo.png" alt="beer n tts logo" width="118" height="82" border="0" longdesc="beer and tts logo no background" /></a></div>'
여기 div의 중심을 찾고 후 나는 내가 만든 한 모든 div를 위해 작동 할 답을 찾을 수가 없어, 단지에이 센터를 가지고있는 #wrap 또는 클래스 .wrap을 가지고 어떤 크기의 브라우저도 도와주세요! :)
이 문제를 해결하는 데 도움이 되었다면 – MVCKarl
을 고맙습니다. @MVCkarl 감사합니다. 해결책을 찾은 방법은 언제까지 작동하지 않았습니다. http://learncss.tutsplus.com/lesson/relative-and-absolute-positioning/ 코드는 다음과 같습니다. #wrap_main { 위치 : 상대적; 여백 : 자동, 너비 : 1200px; } 너비를 가장 일반적인 화면 해상도 1280 픽셀로 조정하고 상대 위치를 지정하여 어린이 div가 절대 위치를 계속 유지할 수 있으며 큰 효과가있는 것 같습니다. 당신은 게으르다. 오히려 많은 div를 그려서 사이트에서 잘 보이도록 만든 다음 다양한 해상도 화면을 중심으로 배치한다. – user1802074