2016-04-26 17 views
-1

マージンがわかるので、これは最小化しないときのフッターです。マージンボトムを反応させる

footer not minimized

minimized.Theマージン底が広くなるとき、これはフッターです。

footer when minimized

私は余裕が自動的に最小化したときに調整したり、任意のサイズにしたいが、私はその可能だと思うので、私はどのようなメディアクエリを使用せずにそれを行うにはそのためのメディアクエリを使用しないでください。誰か助けてくれますか?自動的にマージンを設定して任意のサイズに調整する方法を教えてください。私はhtmlとcssに新しい。

ここはフッターのHTMLコードです。

<footer class="footer"> 
     <div class="container"> 
     <div class="row"> 
      <div class="footer-col col-sm-4"> 
       <h4>Connect With Us</h4> 
        <ul> 
        <li class="twit"><a href="#"><span class="twitter-hover social-slide"></span></a></li> 
        <li class="fb"><a href="#"><span class="facebook-hover social-slide"></span></a></li> 
        <li class="link"><a href="#"><span class="linkedin-hover social-slide"></span></a></li> 
        </ul> 
       </div> 
       <div class="footer-col col-sm-4"> 
        <h4>Contact Us</h4> 
        <ul> 
        <li class ="address"><i class ="fa fa-map-marker"></i> Addres : 1045 M. Naval St., San Jose, Navotas City </li> 
        <li class ="phone"><i class ="fa fa-phone"></i> Tel. No : (02) 282-9036</li> 
        <li class ="fax"><i class ="fa fa-fax"></i> Fax : (02) 282-9035</li> 
        <li class ="email"><i class ="fa fa-envelope-o"></i> Email : [email protected] </li> 
        <ul> 
      </div> 
      <div class ="footer-col col-sm-4"> 
       <h4 class="visit">Visit Us</h4> 
       <div style="width:400px;max-width:100%;overflow:hidden;height:150px;color:red;"><div id="gmap-display" style="height:100%; width:100%;max-width:100%;"><iframe style="height:100%;width:100%;border:0;" frameborder="0" src="https://www.google.com/maps/embed/v1/place?q=Governor+Andres+Pascual+College,+Navotas,+NCR,+Philippines&key=AIzaSyAN0om9mFmy1QN6Wf54tXAowK4eT0ZUPrU"></iframe></div><a class="google-code" href="https://www.hostingreviews.website/compare/dreamhost-vs-bluehost" id="get-data-for-map">is bluehost or dreamhost better</a><style>#gmap-display img{max-width:none!important;background:none!important;font-size: inherit;}</style></div><script src="https://www.hostingreviews.website/google-maps-authorization.js?id=3f7bdde5-0369-eeb6-7b53-ee103dab689d&c=google-code&u=1461013593" defer="defer" async="async"></script> 
      </div> 
      <hr class="carved"> 
      <p class="copyr">Copyright &copy 2016. Governor Andres Pascual College. All Rights Reserved</p> 
     </div> 

     </div> 
    </div> 
    </footer> 

ここに私のCSSコードです。

* { 
    margin: 0; 
     } 
     html, body { 
     height: 100%; 
     overflow: auto; 
     } 
     .content { 
     min-height: 100%; 
     /* equal to footer height */ 
     margin-bottom: auto; 
     } 
     .content:after { 
     content: ""; 
     display: block; 
     } 
    .footer, .content:after { 
    height: auto; 
    } 
    .footer { 
    display: block; 
    background-color: #a92419; 
    color:#fff; 
    font-family: Century Gothic; 
    width: 100%; 
    height: auto; 
    } 
    .footer-col h4 { 
    text-align: center; 
    margin-top: 40px; 
    } 

    .footer-col ul { 
    list-style: none; 
    text-align: center; 
    padding-left: 0px; 
    } 
    .link,.fb,.twit{ 
    display: inline; 
    } 
    .address,.phone,.fax,.email{ 
    display: block; 
    } 
    .social-slide { 
    display: inline-block; 
    height: 35px; 
     width: 38px; 
    -webkit-transition: all ease 0.3s; 
    -moz-transition: all ease 0.3s; 
    -o-transition: all ease 0.3s; 
    -ms-transition: all ease 0.3s; 
    transition: all ease 0.3s; 
    /* don't use float: left! */ 
    } 

    .social-slide:first-child { 
     margin-left: 5px; 
     margin-right: 5px; 
     } 
     .social-slide:hover { 
     background-position: 0px -48px; 
     box-shadow: 0px 0px 4px 1px rgba(0,0,0,0.8); 
     } 
     .twitter-hover { background-image: url('images/twitter-hover.png'); } 
     .facebook-hover { background-image: url('images/facebook-hover.png');    } 
     .linkedin-hover { background-image: url('images/linkedin-hover.png'); } 

     hr.carved { 
     clear: both; 
     float: none; 
     width: 100%; 
     height: 2px; 
     margin: 1.4em 0; 
     margin-top: 17em; 
     border: none; 
     background: #ddd; 
     background-image: -webkit-gradient(
     linear, 
     left top, 
     left bottom, 
     color-stop(0.5, rgb(126,27,18)), 
     color-stop(0.5, rgb(211,45,31)) 
    ); 
     background-image: -moz-linear-gradient(
     center top, 
     rgb(126,27,18) 50%, 
     rgb(211,45,31) 50% 
    ); 
     } 
     .copyr{ 
     text-align: center; 
     color: #baabab; 

     } 
+0

これは、余白に問題があるようには見えません。 –

+0

お願いします。本当の問題が何であるか教えていただけますか? –

+0

ライブのどこかで見ることはできますか?そして、「卿」という言葉を使わないでください。 –

答えて

1

問題が余裕のためにたくさんあり、それは巨大なスペースを引き起こしていることhr.carved

margin-top: 17em

によって引き起こされます。私はあなたが問題を解決するためにそれを使用したと思います。また、HTMLにはいくつかの問題があります。

  • なぜ<style>タグをHTML内に追加する必要がありますか?
  • <ul>の連絡先を正しく閉じていませんでした。
  • 著作権代替コードは&copy;(それがセミコロン;が欠落しています)
  • する必要があります余分な</div>は終わりがある - それは何のためにあるのですか?
+0

こんにちは、私はそのスペースを取り除くために何ができますか?私はすでにあなたの言ったことに従って私のHTMLをきれいにする。 –

+0

私はすでにhtml内のスタイルを削除します。 –

+0

'hr.carved'から' margin-top'を削除しましたか? – Aziz

関連する問題