2012-02-25 3 views
0

table + tr + td를 사용할 때 외부 요소 외부의 내부 요소는 절대로 볼 수 없습니다.하위 div가 상위 div 외부입니까?

하지만 Divs의 경우에도 가능합니다. 이제 내부 div가 부모 div 외부에 위치하는 것을 볼 수 있습니다. 하위 div를 제어하는 ​​방법은 무엇입니까? 내 HTML에서 무엇이 잘못 되었습니까?

은 내가 다음 HTML을 가지고 있고 자식 DIV 내가 좀 당신이 게시하고 모든 것이 잘 작동하는 것 같다 무엇을 만들어 부모

<div id="page"> 
     <div id="main"> 

      <div id="djInfo"> 
      </div> 

      <div id="footer"> 

      </div> 
     </div> 
    </div> 

    #page 
    { 
     width: 100%; 
     margin-left: auto; 
     margin-right: auto; 
     height: 100%; 
     position: relative; 
    } 

    #main 
    {  
     padding: 0px 0px 0px 0px; 
     background-color: #0c1114; 
     margin-bottom: 30px; 
     _height: 1px; /*only IE6 applies CSS properties starting with an underscore */ 
     text-align: center; 
     height: 100%;  
     position: relative; 
    } 

    #footer 
    { 
     color: #999; 
     padding: 0px 0; 
     text-align: center; 
     line-height: normal; 
     margin: 0; 
     font-size: .9em; 
     background-image: url('img/BottomGradient.jpg'); 
     background-repeat:repeat; 
     height: 160px; 
     width: 100%; 
     float: left; 
    } 

#djInfo 
{ 
    float: left; 
    position: relative; 
    margin-left: 250px; 

} 

답변

1

의 외부에있는 것을 볼 의미?

http://jsfiddle.net/XrDTe/

는하지만, 이중 코드를 확인하십시오, 그것은 약간의 중복이 있습니다.

(왼쪽/오른쪽으로 100 % 여백을주는 이유는 무엇입니까?) 왜 모든 float : left와 position : relative의 이유? IE6 높이가 1px 인 이유는 무엇이든지 필요하지 않으며 사용자를 방해 할 수 있습니다. 점잖은, 요점 CSS 작성)

관련 문제