2013-08-14 4 views
2

에 확대되지 내가 왜 절대 위치 div의 높이에 (div.class1을) 확대되지 확실하지 않다절대 위치 DIV 높이

바이올린 : http://jsfiddle.net/z9Unk/209/

HTML

<div class="container"> 
    <div class="content"> 
    <div class="space"> 
    </div> 
    <div class="class1 hz"> 
     <div class="class2 class3"> 
     item2 
     </div> 
     <div class="class2 class3"> 
     item2 
     </div> 
    </div> 
    </div> 
</div> 

CSS

.container { 
    position:relative; 
    height: 100%; 
    width:100%; 
} 
.space { 
    margin-top:80px; 
} 

.content { 
    height:100%; 
    border:1px solid transparent; 
} 

.hz { 
    top:20%; 
    margin:0 auto; 
    left:0px; 
    right:0px; 
    display:inline-block; 
} 


.class1 { 
    position: absolute; 
    top:160px; 
    width: 985px; 
    height:100%; 
    border:1px solid blue; 
} 

.class2 { 
    width : 275px; 
    height : 250px; 
    margin-right:20px; 
    border:1px solid red; 
} 

.class3 { 
    width : 325px; 
    height: 280px; 
    margin-right:3px; 
    display:inline-block; 
} 

이 문제를 해결하는 데 도움을주세요. 상대와는 높이 100 % 맞는

jsFiddle에

+0

예 ... 나는 그 소식을 업데이트한다. – GJain

+1

정확히 무엇인지 모르겠지만 "html, body {height : 100 %;}를 스타일에 추가하십시오. http://jsfiddle.net/krrwM/ –

+1

당신은 무엇을하려고하는지 실제로 설명하지 않았습니다. – Itay

답변

0

변경 위치 : http://jsfiddle.net/AhmedAlaaElDin/z9Unk/212/

.class1 { 
    position: relative; 
    top:160px; 
    width: 985px; 
    height:100%; 
    border:2px solid blue; 
} 
+0

시도해 보겠습니다.이/ – GJain

+0

과 무엇을 얻었습니까? –

+0

그래서 아직 시도 할 필요가 있습니다. 사실, 나는 끈적 끈적한 바닥 글을 할 필요가있다. 다른 이슈들에 부딪혔다. 나는 곧 포스트를 업데이트 할 것이다. – GJain

2

.class1 { 
    position: absolute; 
    display:table; 
    top:160px; 
    width: 985px; 
    height:100%; 
    border:1px solid blue; 
} 

업데이트 바이올린을 .class1하는 display:table;를 추가 http://jsfiddle.net/z9Unk/213/