保证金底部响应

时间:2016-04-26 14:43:01

标签: html css twitter-bootstrap

这是未最小化时的页脚,因为您可以看到边距正常。

footer not minimized

这是最小化时的页脚。页边距变宽。

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 : gapc_school@yahoo.com.ph </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;

      }

1 个答案:

答案 0 :(得分:1)

问题是由hr.carved

引起的
  

margin-top: 17em

这是一个很大的差距,它正在造成巨大的空间。我认为你使用它是因为清除问题。此外,您的HTML还有其他一些问题。

  • 为什么需要在HTML中添加<style>标记?
  • 您没有正确联系我们<ul>
  • 版权alt代码应为&copy;(它缺少分号;
  • 最后还有一个</div> - 它的用途是什么?