2017-09-29 20 views
0

現在、私のホームページのフッタに問題があります。スライドショーがあり、私のフッターをチェックするためにw3schoolの縦型テーブルコードを貼り付けることを試みました。HTML、CSS - ページ内のコンテンツがフッターに重複しています

私は相対的な位置に変更したにもかかわらず、私のフッタはページの下部に静的ではありませんでした。

P.s - 私は他の同様の投稿のソリューションでも試してみましたが、何も私のためには動作しません。

本当に助けが必要です。

body { 
 
    background-color: #d62929; 
 
    font-family: Verdana, sans-serif; 
 
    margin: 0; 
 
} 
 

 
ul { 
 
    list-style-type: none; 
 
    margin: 0; 
 
    padding: 0; 
 
    overflow: hidden; 
 
    background-color: whitesmoke; 
 
    font-weight: bold; 
 
    font-size: 18px; 
 
} 
 

 
li { 
 
    float: left; 
 
} 
 

 
li a, 
 
.dropbtn { 
 
    display: inline-block; 
 
    color: black; 
 
    text-align: center; 
 
    padding: 22px 30px; 
 
    text-decoration: none; 
 
} 
 

 
li a:hover, 
 
.dropdown:hover .dropbtn { 
 
    background-color: #c12525; 
 
    color: white; 
 
} 
 

 
li.dropdown { 
 
    display: inline-block; 
 
} 
 

 
.dropdown-content { 
 
    display: none; 
 
    position: absolute; 
 
    background-color: whitesmoke; 
 
    min-width: 250px; 
 
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); 
 
    z-index: 1; 
 
} 
 

 
.dropdown-content a { 
 
    color: black; 
 
    padding: 20px 20px; 
 
    text-decoration: none; 
 
    display: block; 
 
    text-align: left; 
 
    font-size: 15px; 
 
} 
 

 
.dropdown-content a:hover { 
 
    background-color: #c12525; 
 
} 
 

 
.dropdown:hover .dropdown-content { 
 
    display: block; 
 
} 
 

 
.active { 
 
    background-color: #d62929; 
 
    color: white; 
 
    font-weight: bold; 
 
    font-size: 18px; 
 
} 
 

 
@media screen and (max-width: 600px) { 
 
    ul li, 
 
    ul li { 
 
    float: none; 
 
    } 
 
} 
 

 
* { 
 
    box-sizing: border-box; 
 
} 
 

 
.mySlides { 
 
    display: none; 
 
} 
 

 

 
/* Slideshow container */ 
 

 
.slideshow-container { 
 
    max-width: 950px; 
 
    position: relative; 
 
    margin: auto; 
 
} 
 

 

 
/* Caption text */ 
 

 
.text { 
 
    color: black; 
 
    font-size: 15px; 
 
    padding: 8px 12px; 
 
    position: absolute; 
 
    bottom: 8px; 
 
    width: 100%; 
 
    text-align: center; 
 
} 
 

 

 
/* Number text (1/3 etc) */ 
 

 
.numbertext { 
 
    color: black; 
 
    font-weight: bold; 
 
    font-size: 12px; 
 
    padding: 8px 12px; 
 
    position: absolute; 
 
    top: 0; 
 
} 
 

 

 
/* The dots/bullets/indicators */ 
 

 
.dot { 
 
    height: 13px; 
 
    width: 13px; 
 
    margin: 0 2px; 
 
    background-color: #bbb; 
 
    border-radius: 50%; 
 
    display: inline-block; 
 
    transition: background-color 0.6s ease; 
 
} 
 

 
.active2 { 
 
    background-color: #717171; 
 
} 
 

 

 
/* Fading animation */ 
 

 
.fade { 
 
    -webkit-animation-name: fade; 
 
    -webkit-animation-duration: 1.5s; 
 
    animation-name: fade; 
 
    animation-duration: 1.5s; 
 
} 
 

 
@-webkit-keyframes fade { 
 
    from { 
 
    opacity: .4 
 
    } 
 
    to { 
 
    opacity: 1 
 
    } 
 
} 
 

 
@keyframes fade { 
 
    from { 
 
    opacity: .4 
 
    } 
 
    to { 
 
    opacity: 1 
 
    } 
 
} 
 

 

 
/* On smaller screens, decrease text size */ 
 

 
@media only screen and (max-width: 300px) { 
 
    .text { 
 
    font-size: 11px 
 
    } 
 
    footer { 
 
    -webkit-order: 3; 
 
    order: 3; 
 
    } 
 
} 
 

 
footer { 
 
    background: #aaa; 
 
    color: white; 
 
    position: static; 
 
    right: 0; 
 
    bottom: 0; 
 
    left: 0; 
 
    height: 1rem; 
 
    text-align: center; 
 
} 
 

 
.footp { 
 
    margin: 0; 
 
    padding: 0; 
 
    margin-left: 20px; 
 
    display: inline-block; 
 
    line-height: 30px; 
 
    vertical-align: top; 
 
} 
 

 

 
/* Style the tab */ 
 

 
div.tab { 
 
    float: left; 
 
    border: 1px solid #ccc; 
 
    background-color: #f1f1f1; 
 
    width: 30%; 
 
    height: 300px; 
 
} 
 

 

 
/* Style the buttons inside the tab */ 
 

 
div.tab button { 
 
    display: block; 
 
    background-color: inherit; 
 
    color: black; 
 
    padding: 22px 16px; 
 
    width: 100%; 
 
    border: none; 
 
    outline: none; 
 
    text-align: left; 
 
    cursor: pointer; 
 
    transition: 0.3s; 
 
    font-size: 17px; 
 
} 
 

 

 
/* Change background color of buttons on hover */ 
 

 
div.tab button:hover { 
 
    background-color: #ddd; 
 
} 
 

 

 
/* Create an active/current "tab button" class */ 
 

 
div.tab button.active { 
 
    background-color: #ccc; 
 
} 
 

 

 
/* Style the tab content */ 
 

 
.tabcontent { 
 
    float: left; 
 
    padding: 0px 12px; 
 
    border: 1px solid #ccc; 
 
    width: 70%; 
 
    border-left: none; 
 
    height: 300px; 
 
}
<body> 
 
    <div class="flex-container"> 
 
    <ul> 
 
     <li><a class="active" href="">A</a></li> 
 
     <li class="dropdown"> 
 
     <a href="javascript:void(0)" class="dropbtn">B</a> 
 
     <div class="dropdown-content"> 
 
      <a href="">D</a> 
 
      <a href="">E</a> 
 
     </div> 
 
     </li> 
 
     <li><a href="">Contact</a>C</li> 
 
    </ul> 
 

 
    <br /><br /> 
 
    <div class="slideshow-container"> 
 

 
     <div class="mySlides fade"> 
 
     <div class="numbertext">1/7</div> 
 
     <img src="image1.jpg" style="width:100%"> 
 
     <div class="text"></div> 
 
     </div> 
 

 
     <div class="mySlides fade"> 
 
     <div class="numbertext">2/7</div> 
 
     <img src="image2.jpg" style="width:100%"> 
 
     <div class="text"></div> 
 
     </div> 
 

 
     <div class="mySlides fade"> 
 
     <div class="numbertext">3/7</div> 
 
     <img src="image3.jpg" style="width:100%"> 
 
     <div class="text"></div> 
 
     </div> 
 

 
     <div class="mySlides fade"> 
 
     <div class="numbertext">4/7</div> 
 
     <img src="image4.jpg" style="width:100%"> 
 
     <div class="text"></div> 
 
     </div> 
 

 
     <div class="mySlides fade"> 
 
     <div class="numbertext">5/7</div> 
 
     <img src="image5.jpg" style="width:100%"> 
 
     <div class="text"></div> 
 
     </div> 
 

 
     <div class="mySlides fade"> 
 
     <div class="numbertext">6/7</div> 
 
     <img src="image6.jpg" style="width:100%"> 
 
     <div class="text"></div> 
 
     </div> 
 

 
     <div class="mySlides fade"> 
 
     <div class="numbertext">7/7</div> 
 
     <img src="image7.jpg" style="width:100%"> 
 
     <div class="text"></div> 
 
     </div> 
 
    </div> 
 
    <br> 
 

 
    <div style="text-align:center"> 
 
     <span class="dot" onclick="currentSlide(1)"></span> 
 
     <span class="dot" onclick="currentSlide(2)"></span> 
 
     <span class="dot" onclick="currentSlide(3)"></span> 
 
     <span class="dot" onclick="currentSlide(4)"></span> 
 
     <span class="dot" onclick="currentSlide(5)"></span> 
 
     <span class="dot" onclick="currentSlide(6)"></span> 
 
     <span class="dot" onclick="currentSlide(7)"></span> 
 
    </div> 
 

 
    <div class="tab"> 
 
     <button class="tablinks" onclick="openCity(event, 'London')" id="defaultOpen">London</button> 
 
     <button class="tablinks" onclick="openCity(event, 'Paris')">Paris</button> 
 
     <button class="tablinks" onclick="openCity(event, 'Tokyo')">Tokyo</button> 
 
    </div> 
 

 
    <div id="London" class="tabcontent"> 
 
     <h3>London</h3> 
 
     <p>London is the capital city of England.</p> 
 
    </div> 
 

 
    <div id="Paris" class="tabcontent"> 
 
     <h3>Paris</h3> 
 
     <p>Paris is the capital of France.</p> 
 
    </div> 
 

 
    <div id="Tokyo" class="tabcontent"> 
 
     <h3>Tokyo</h3> 
 
     <p>Tokyo is the capital of Japan.</p> 
 
    </div> 
 

 
    <div> 
 
     <footer> 
 
     <p class="footp">&copy; 2017 . All rights reserved.</p> 
 
     <p class="footp">|</p> 
 
     <p class="footp"> Internal Use Only</p> 
 
     <p class="footp">|</p> 
 
     <p class="footp">Maintained By : </p> 
 
     </footer> 
 
    </div> 
 
    </div> 
 
</body>

答えて

2

フッターの前に浮動divをそこ持って、あなたは浮遊効果をクリアするとフッターからの高さを削除する必要があります。デフォルトの位置でのHTMLコンテンツ:静的で静的な位置の上/右/下/左の位置は適用されません。

このCSSスタイルを変更してください。

footer { 
    background: #aaa; 
    color: #fff; 
    text-align: center; 
    clear: both; /* clearing floating affects from both left,right sides */ 
} 
0

Javaで通常のテーブルタイプを使用しようとしましたか?私はこのように簡単だと思います。

<table> 
    <tr> 
     <td> 
      add your code here 
     </td> 
    </tr> 

</table> 
+0

表はスタイリング用ではありません。これはOPの質問に対する誤った答えです。 – Hamzaouiii

関連する問題