2013-08-05 2 views
1

MDI 웹 응용 프로그램을 작성하고 내용이 headersectionarticle 요소로 창을 만들었습니다. MDI 응용 프로그램이기 때문에 은 absolute으로 설정되어 다른 창과 겹칠 수 있습니다. 콘텐츠 섹션에는 스크롤바가 필요하지만, header에는 표시되지 않습니다.오버플로시 스크롤 막대를 가져올 수 없습니다.

<article id="win3"> 
    <header> … </header> 
    <section> … </section> 
</article> 

CSS : 그것은 overflow: auto처럼 보이는

article { 
    position: absolute; 
    min-width: 500px; 
    width: 918px; 
    margin: 0px; 
    padding: 0px; 
    overflow: hidden; 
    background-color: white; 
    border-style: ridge; 
    border-color: #ddd; 
    border-width: 4px; 
} 
article>section { 
    /* reduce diameter of rounded corner to match the inside curve of the border */ 
    border-radius: 10px; 
    -moz-border-radius: 10px; 
    display: block; 
    overflow: auto; 
    border: none; 
    width: 100%; 
    background-color: white; 
    padding: 10px 10px 10px 20px; 
    min-height: 50px; 
    height: 100%; 
} 

파이어 폭스 (22 절)에서 무시되지만 스크롤 막대가 크롬에 나타나지 않습니다.

콘텐츠 섹션에 필요할 때 스크롤 막대를 안정적으로 만드는 방법에 대한 아이디어가 있습니까?

답변

3

키 문제는 패딩 값이다, 그래서 당신은 당신의 기사의 일부 비율> 섹션 빠른 응답

article>section { 
    /* reduce diameter of rounded corner to match the inside curve of the border */ 
    border-radius: 10px; 
    -moz-border-radius: 10px; 
    display: block; 
    overflow: auto; 
    border: none; 
    /*width: 100%;*/ 
    width: calc(100% - 30px) /* or set fixed width percentage like 90% */ 
    background-color: white; 
    padding: 10px 10px 10px 20px; 
    min-height: 50px; 
    height: 100%; 
} 
+1

안녕하세요, Calc는 매우 멋지다 - 그 사실을 인식하지 못했습니다. Chrome에서는 스크롤바가 다시 표시되지만 Firefox에서는 여전히 운이 좋지 않습니다. – user2651397

+0

크롬 사용 -webkit-calc (100 % - 30px) 및 firefox의 경우 -moz-calc()를 사용하지만 적어도 Safari 6.0은 작동합니다. 그래서 제 제안은 98 %와 같은 고정 너비를 사용합니다 –

+0

흠. 고정 된 크기를 픽셀로 설정하더라도 여전히 스크롤바가 표시되지 않습니다. 페이지를 검사 할 때 Firefox는 섹션 주위에 윤곽선을 그리고 기사를 넘어 명확하게 확장됩니다. 그러나 Firefox는 여전히 스크롤바를 표시하지 않습니다. – user2651397

0
article { 
    position: absolute; 
    min-width: 500px; 
    width: 918px; 
    margin: 0px; 
    padding: 0px; 
    overflow: hidden; 
    background-color: white; 
    border-style: ridge; 
    border-color: #ddd; 
    border-width: 4px; 
    height:100px; 
} 
article>section { 
    /* reduce diameter of rounded corner to match the inside curve of the border */ 
    overflow:auto; 
    height:100%; 
    border:none; 
    display: block; 
    padding: 10px 10px 10px 20px; 
    min-height:50px; 
} 
+0

감사를 감소 폭을 설정해야합니다. 그것은 문제를 해결하지 못했습니다. 제안 된 변경 사항을 적용한 후에는 스크롤 막대가 더 이상 Chrome에 표시되지 않으며 Firefox에도 표시되지 않습니다. – user2651397

관련 문제