2014-11-05 2 views
0

바닥 글 탐색을 수행하지 않으려면 사이드 바가 필요합니다. 나는 이것을 위해 CSS를 편집하는 방법을 알아낼 수 없다. HTML 및 CSS와 함께 미리보기가 있습니다. 그래서 내가 찾고있는 것은 footer border-top의 "collision"입니다. 그래서 사이드 바가 그것과 상호 작용할 수 있습니다. http://codepen.io/TheGamingHideout/pen/reayxCSS 사이드 바 바닥 글 감지

HTML :

<html> 

    <head> 
    <title>Home - POG</title> 
    <link rel="shortcut icon" href="http://www.thegaminghideout.com/pog/favicon.ico"> 
    <link rel="stylesheet" type="text/css" href="style.css"> 
    <!-- This Template is a WiP - Please report any bugs to the administrative team at The Gaming Hideout. Thank you. All rights reserved. --> 
    </head> 

    <body> 
    <div id="wrap"> 
     <div id="header"> 
     <h1><img src="http://www.thegaminghideout.com/pog/VexIMG/header.png" alt="Possessed Gaming" width="760" height="60"></h1> 
     </div> 
     <div id="navigation"> 
     <div class="navlinks"> 
      <div id="output2"> 
      </div> 
     </div> 
     <script src="nav.js"></script> 
     </div> 
     <div id="buttons"> 
     <img src="http://www.thegaminghideout.com/pog/VexIMG/donate.png"> 
     </div> 
     <div id="body"> 
     <center> 
      <h2>Welcome to Possessed Gaming DarkRP!</h2> 
      <h4>Owned by PossessedGaming</h4> 
     </center> 
     <p>Thanks for choosing our GMod server! You are currently playing DarkRP on PossessedGaming. Make sure to read and follow the rules below!</p> 
     <br> 
     <h3>Rules</h3> 
     <ul> 
      <li>Do NOT RDM</li> 
      <li>NLR 3 Minutes!</li> 
      <li>Respect Staff</li> 
      <li>Do NOT spam chat or mic</li> 
      <li>Have Fun!</li> 
     </ul> 
     <p>Disobeying these rules or finding loopholes around them can and will result in punishments including kicks, bans, mutes, weapon strips, and jails.</p> 
     <br> 
     <p>Click <a href="application.php">here</a> to apply for staff!</p> 
     <div id="latest"> 
      <center> 
      <img src="http://www.thegaminghideout.com/pog/VexIMG/Index/latest.png"> 
      <p id="output1"></p> 
      <script src="latest.js"></script></center> 
     </div> 
     </div> 
     <div id="footer"> 
     <div id="copyright"> 
      Copyright © The Gaming Hideout 
      <br>We own no rights on any game on this site unless otherwise noted. 
      <br>All Rights Reserved. 
     </div> 
     <div id="footnav"> 
      <script src="footnav.js"></script> 
     </div> 
     </div> 
    </div> 
    </body> 

</html> 

CSS :

html, body { 
    margin: 0; 
    padding: 0; 

} 
.hidden { 
    display: none; 
} 
body { 
    background: url(http://www.thegaminghideout.com/pog/VexIMG/bg.png); 
    background-color: black; 
    background-size: 100%; 
    background-repeat: no-repeat; 
    font-size: 12px; 
    color: #666666; 
} 
@font-face { 
    font-family: 'karmatic_arcaderegular'; 
    src: url('http://www.thegaminghideout.com/pog/fonts/ka1-webfont.eot'); 
    src: url('http://www.thegaminghideout.com/pog/fonts/ka1-webfont.eot?#iefix') format('embedded-opentype'), 
    url('http://www.thegaminghideout.com/pog/fonts/ka1-webfont.woff2') format('woff2'), 
    url('http://www.thegaminghideout.com/pog/fonts/ka1-webfont.woff') format('woff'), 
    url('http://www.thegaminghideout.com/pog/fonts/ka1-webfont.ttf') format('truetype'), 
    url('http://www.thegaminghideout.com/pog/fonts/ka1-webfont.svg#karmatic_arcaderegular') format('svg'); 
    font-weight: normal; 
    font-style: normal; 

} 
p, h1, h2, h3, h4, h5, h6, caption, text, font, li, ul { 
    color: white; 
} 
#wrap { 
    width: 760px; 
    margin: auto; 
    overflow: hidden; 
} 
#header { 
    height: 60px; 
    width: auto; 
    background: #db6d16 
    url(VexIMG/header.png); 
} 
#navigation { 
    width: 760px; 
    height: 35px; 
    position: absolute; 
    border-bottom: 2px solid #000000; 
    background: red; 
    padding: 0px; 
} 
#navigation .padding { 
    padding: 2px; 
} 
#navigation .navlinks { 
    position: absolute; 
    top: 1px; left: 0px; 
} 
#navigation .navlinks ul { 
    margin: 0px; 
    padding: 0px; 
    text-align: center; 
    list-style-type: none; 
    width: 760px; 
    height: 35px; 
} 
#navigation .navlinks li { 
    position: relative; 
    top: 5px; 
    margin: 0px 5px 0px 5px; 
    list-style-type: none; 
    display: inline; 
} 
#navigation .navlinks li a { 
    color: #000000; 
    padding: 5px 0px 9px 0px; 
    text-decoration: none; 
    font-size: 18px; 
    font-family: karmatic_arcaderegular; 
    padding: 5px 0px 9px 0px; 
} 
#navigation .navlinks li a:hover { 
    margin: 0px; 
    color: #ffffff; 
    background: red; 
    text-decoration: underline; 
} 
#buttons { 
    padding-bottom: 2000px; 
    margin-bottom: -2000px; 
    width: 155px; 
    border-left: 2px solid #FFA500; 
    border-right: 2px solid #FFA500; 
    float: right; 
    font-family: Terminal, Arial, Times New Roman; 
    background: linear-gradient(#700000, #250000); 
} 
#latest { 
    border: 1px ridge #FFA500; 
    width: 300px; 
    height: auto; 
    background: linear-gradient(#000000, #252525, #000000); 
    clear: left; 
} 
#latest p { 
    font-family: Times New Roman; 

} 
#body { 
    padding-top: 50px; 
    width: 600px; 
    font-family: Arial, Verdana, Terminal; 
    font-size: 14px; 
} 
#body .secret img { 
    width: 150px; 
    height: 100px; 
    border: 2px solid black; 
} 
#body .game { 
    padding: 3px 3px 10px 3px; 
} 
#body .game img { 
    align: center; 
    float: left; 
    width: 175px; 
    height: 101px; 
    border: 2px ridge #ff0000; 
} 
#body .game caption { 
    padding-left: 1px; 
} 
#body .space { 
    padding-top: 10px; 
    padding-bottom: 10px; 
    border-top: 4px ridge red; 
    border-bottom: 4px ridge red; 
} 
#body .game caption { 
    margin-top: 2px; 
    float: right; 
    font-family: Terminal, Arial, Verdana, San-Serif; 
    font-size: 12px; 
    color: #000000; 
    border-bottom: 2px dashed #e9e9e9; 
} 
#body .game a { 
    font-family: Terminal, Arial, San-Serif, Tahoma; 
    font-size: 10px; 
    color: #c9c9c9; 
    text-decoration: none; 
} 
#body .game a:hover { 
    font-family: Terminal, Arial, San-Serif, Tahoma; 
    font-size: 10px; 
    color: red; 
    text-decoration: underline; 
} 
#footer { 
    width: 730px; 
    height: 60px; 
    font-family: Tahoma, Arial, Terminal, San-Serif; 
    font-size: 10px; 
    color: #c9c9c9; 
    border-top: 1px solid #efefef; 
    padding: 13px 25px; 
    line-height: 18px; 
} 
#footer li { 
    padding: 0px 2px 0px 2px; 
    float: right; 
    display: inline; 
    text-align: left; 
    font-family: Terminal, Arial, San-Serif, Tahoma;      
    font-size:; 10px; 
} 
#footer a { 
    font-family: Terminal, Arial, San-Serif, Tahoma; 
    font-size: 10px; 
    color: #c9c9c9; 
    text-decoration: none; 
} 
#footer a:hover { 
    font-family: Terminal, Arial, San-Serif, Tahoma; 
    font-size: 10px; 
    color: red; 
    text-decoration: underline; 
} 
#footer #footnav { 
    display: inline; 
    width: 310px; 
    float: right; 
    text-align: left; 
    position: relative; 
    bottom: 65px; 
} 
+0

힌트 : HTML 요소 'id'를 CSS 선택기로 사용하지 마십시오. 그것은 최악의 연습 이상입니다. – lexith

+0

부트 스트랩의 그리드 시스템과 같은 것을 사용하십시오. 이처럼 쉽게 레이아웃을 설정할 수 있습니다. http://getbootstrap.com/css/#grid – MattD

답변

0

위치 추가 : 래퍼에 상대적이며 position : absolute를 사용하여 #button을 배치하는 것은이를 해결하는 방법입니다. #wrap과 #button의 상단과 하단 사이의 정확한 거리를 알아야한다는 것을 명심하십시오.

다른 해결책도있을 것이라고 말했습니다.

#wrap { 
    position: relative; 
    width: 760px; 
    margin: auto; 
    overflow: hidden; 
} 
#buttons { 
    position: absolute; 
    right: 0px; 
    top: 110px; 
    bottom: 95px; 
    width: 155px; 
    border-left: 2px solid #FFA500; 
    border-right: 2px solid #FFA500; 
    font-family: Terminal, Arial, Times New Roman; 
    background: linear-gradient(#700000, #250000); 
} 
+0

감사합니다. @more, 1 질문이 더 있습니다. '# footer'와'# navigation'의 경계를 어떻게 보이게 할 수 있습니까? 선택 사항이지만 선호합니다. –

+0

아래쪽에 몇 가지 추가 픽셀을 추가하십시오 : and top : - 값. 이렇게하면 컨테이너를 몇 픽셀 이동하여 테두리가 표시됩니다. 상단 : 113px; 하단 : 96px가 원하는 값인 것 같습니다. – RMo

0

사용하는 대신이 현재 view.But에 정하는 것 padding-bottom: 2000px;margin-bottom: -2000px;#buttons에 대한 margin-bottom: -648px;padding-bottom: 648px; 당신이 그것을 원하는 경우 필요한 모든 페이지에서 동적으로 javascript를 사용하여 화면 높이를 감지하고 패딩 하단과 여백 bottom을 결정하십시오. 도움이 될 것입니다.

0

?

#buttons { 
    height:645px; 
} 

http://codepen.io/mmp1992/pen/bnrvw

와 패딩과 마진을 제거합니다.

+0

그래,하지만 브라우저와 화면 해상도에 따라 바뀌어 보인다. –