2012-09-10 2 views
1

저는 기본적인 HTML과 CSS 테스트를하고 있었는데 문제가 생겼을 때 전혀 해결할 수 없었습니다.body 태그가 컨트롤을 표시하지 않습니다. (크기 변경)

파일 :

test2.html :

<!DOCTYPE html> 
<html> 
<head> 
    <meta charset="utf-8" /> 
    <link rel="stylesheet" href="test2.css"> 
</head> 
<body class="design1"> 
    <div id="container"> 
    <div id="menu" class="box"> 
    <a href="test2.html#text1" class="box">Abschitt 1</a> 
    <a href="test2.html#text2" class="box">Abschitt 2</a> 
    <a href="test2.html#text3" class="box">Abschitt 3</a> 
    </div> 
    <div id="main" class="box"> 
    <div id="header" class="box"> 
     <span class="box head">Test2</span> 
     <span class="box head">Überschrift</span> 
     <span class="box head">10.09.2012</span> 
    </div> 
    <div id="text" class="box"> 
    <p id="text1" class="box"> 
     Lorem ipsum ... 
    </p> 
    <p id="text2" class="box"> 
     Lorem ipsum... 
    </p> 
    <p id="text3" class="box"> 
     Lorem ipsum... 
    </p> 
    </div> 
    <div id="footer" class="box"> 
     Von #### 
    </div> 
    </div> 
    </div> 
</body> 
</html> 

test2.css : 나는 방화범 부스가있는 페이지를 보면

html, body, div, span { 
    background: none repeat scroll 0% 0% transparent; 
    border: 0px none; 
    font-size: 100%; 
    margin: 0px; 
    padding: 0px; 
    outline: 0px none; 
    vertical-align: baseline; 
} 

.box { 
    background: rgba(0, 0, 67, 0.2); 
    border-color: rgba(0, 0, 67, 1.0); 
    border-width: 1px; 
    border-style: solid; 
} 

#menu { 
    position: absolute; 
    left: 5px; 
    top: 5px; 
    width: 200px; 
    bottom: 5px; 
} 

#main { 
    position: absolute; 
    left: 210px; 
    top: 5px; 
    right: 5px; 
    bottom: 5px; 
} 

, html로 신체 요소가 크기가 0 배 x 100 % (너비)이고 표시되지 않습니다 (innerHTML 부분이 표시됨). 마지막 스타일 지정을 지우지 만 정상 동작으로 돌아가서 전체 페이지의 크기 (100 % x 100 %)를 갖습니다. 이런 방법을 피하기 위해 왜

html, body, div, span { 
    background: none repeat scroll 0% 0% transparent; 
    border: 0px none; 
    font-size: 100%; 
    margin: 0px; 
    padding: 0px; 
    outline: 0px none; 
    vertical-align: baseline; 
} 

.box { 
    background: rgba(0, 0, 67, 0.2); 
    border-color: rgba(0, 0, 67, 1.0); 
    border-width: 1px; 
    border-style: solid; 
} 

#menu { 
    position: absolute; 
    left: 5px; 
    top: 5px; 
    width: 200px; 
    bottom: 5px; 
} 

사람이 알고 있나요 : 마지막 스펙을 삭제 한 후

test2.css?

+0

시도 [여기] (http://jsfiddle.net/qGMD5/) ... 예상 된 동작입니까? – Gabber

+0

예. 변경 전후의 Firebug로 html/body 요소의 크기를 살펴보십시오. body 요소는 # container/nothing뿐만 아니라 모든 요소를 ​​둘러 쌓아야합니다. – user1661264

답변

관련 문제