2013-04-17 3 views
-1

내 메인 컨텐츠의 양면에 드롭 섀도우를 사용하고 싶었지만 페이지 하단에 도달하지 못했습니다. 끝나기 전에 100이나 Px처럼 보이는 것을 잘라냅니다. 이유를 알아낼 수 없었습니다. 어떤 도움을 주셔서 감사합니다!CSS 드롭 섀도우가 페이지 하단에 도달하지 않습니까?

HTML 파일 : http://db.tt/0z0cNVIt 스타일 시트 : http://db.tt/1cJDzbJ0

HTML

<div id="container"> 
    <div id="sidebar"> 
     <img name="logo" src="" width="280" height="150" alt="" /> 
     <br /> 
     <br />Babylon Citizens Council of the Arts is a not-for-profit arts organization bringing theatre, music, fine arts and cultural events to the residents of the Town of Babylon. 
     <br /> 
     <br /> 
     <ul id="nav"> 
      <li><a href="about.html">About</a> 
      </li> 
      <li><a href="events.html">Events</a> 
      </li> 
      <li><a href="programs.html">Programs</a> 
      </li> 
      <li><a href="comp.html">Competitions</a> 
      </li> 
      <li><a href="photos.html">Photos</a> 
      </li> 
      <li><a href="membership.html">Membership</a> 
      </li> 
      <li><a href="contact.html">Contact</a> 
      </li> 
     </ul> 
     <br />Follow us on social networks! 
     <br /> 
     <br /> 
<a href="#"><img src="images/fb.png" /></a> <a href="#"><img src="images/twitter.png" /></a> 

    </div> 
    <div class="content"> 
     <h3>Welcome to the Babylon Citizens Council on the Arts!</h3> 

     <p><a href="#">link test</a> 
     </p> 
     <div id="slider">SLIDER WILL BE HERE</div> 
     <!-- end .content --> 
    </div> 
    <!-- end .container --> 
</div> 

CSS

당신은 제거 할 필요가
@charset"UTF-8"; 
html, body { 
    height: 100%; 
} 
body { 
    font: 12px Verdana, Arial, Helvetica, sans-serif; 
    line-height: 22px; 
    background: url(images/bg.png); 
    margin: 0; 
    padding: 0; 
    color: #666; 
} 
/* ~~ Element/tag selectors ~~ */ 
ul, ol, dl { 
    /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */ 
    padding: 0; 
    margin: 0; 
} 
h1, h2, h3, h4, h5, h6, p { 
    margin-top: 0; 
    /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */ 
    padding-right: 15px; 
    padding-left: 15px; 
    /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */ 
} 
a img { 
    /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */ 
    border: none; 
} 
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */ 
a:link { 
    color: #42413C; 
    text-decoration: underline; 
    /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */ 
} 
a:visited { 
    color: #6E6C64; 
    text-decoration: underline; 
} 
a:hover, a:active, a:focus { 
    /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */ 
    text-decoration: none; 
} 
/* ~~ this fixed width container surrounds all other elements ~~ */ 
#container { 
    width: 960px; 
    height: 100%; 
    background: #FFF; 
    display: block; 
    margin: 0 auto; 
    /* the auto value on the sides, coupled with the width, centers the layout */ 
    -moz-box-shadow: 10px 0 5px -10px #cab7aa, -10px 0 5px -10px #cab7aa; 
    -webkit-box-shadow: 10px 0 5px -10px #cab7aa, -10px 0 5px -10px #cab7aa; 
    box-shadow: 10px 0 10px -10px #cab7aa, -10px 0 10px -10px #cab7aa; 
    /* For IE 8 */ 
    -ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#cab7aa')"; 
    /* For IE 5.5 - 7 */ 
    filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#cab7aa'); 
} 
/* ~~ This is the layout information. ~~ 

1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design. 

*/ 
#sidebar { 
    width: 280px; 
    height: 100%; 
    float: left; 
    background-color: #f5e9e0; 
    padding: 40px; 
} 
#nav { 
    list-style-type: none; 
    line-height: 32px; 
} 
#nav a, #nav a:link, #nav a:visited, #nav a:active { 
    text-decoration: none; 
    border-bottom: 1px dotted #784e33; 
    display: block; 
} 
#nav a:hover { 
    text-decoration: none; 
    border-bottom: 1px dotted #784e33; 
    background-color: #fcf5f0; 
} 
.content { 
    width: 560px; 
    height: 100%; 
    float: right; 
    background-color: #FFF; 
    padding: 40px 20px 40px 20px; 
} 
/* ~~ miscellaneous float/clear classes ~~ */ 
.fltrt { 
    /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */ 
    float: right; 
    margin-left: 8px; 
} 
.fltlft { 
    /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */ 
    float: left; 
    margin-right: 8px; 
} 
.clearfloat { 
    /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */ 
    clear:both; 
    height:0; 
    font-size: 1px; 
    line-height: 0px; 
} 
+2

http://jsfiddle.net/에서 피들에 코드를 추가하십시오. – Interrobang

+1

하나를 입력했습니다. http://jsfiddle.net/Allendar/7mJMx/ –

답변

0

당신의 bodyhtml 높이 (100 %는 브라우저 높이 만 사용함)를 입력하고 container div를 닫기 전에 지우기 div를 입력하십시오.

용지 사업부 : <div style="clear: both;"></div>

는 여기를 참조하십시오 : @Allendar에 http://jsfiddle.net/7mJMx/1/

감사를 원래 jsfiddle을 만들기 위해!

+0

감사합니다, 피들에 대해 미안 해요! 훌륭하게 작동합니다. – detection

+0

플로트를 지우는 데 여분의 마크 업을 사용하는 것은 10 년 전입니다. http://codepen.io/cimmanon/pen/qDjdr – cimmanon

+1

@ user1909137, 도움이된다면 대답을 수락하십시오. –

관련 문제