页脚文本溢出4列。我该如何预防?

时间:2013-09-06 17:54:59

标签: html css footer

我有一个四列页脚,可以正常工作,直到浏览器窗口缩小。

然后第二列(Div ID 4th)将在其他一个框下面开始推文:

在网站上更容易看到:Teetimelawn.com

我尝试了一些解决方案,但他们通常最终将div推到第四位,接近其他3个内联div列。

这是CSS信息:

.footer {
    background-color: #336600;
    clear: both;
    float: none;
    padding-top: 10px;
    padding-right: 0;
    padding-bottom: 0px;
    padding-left: 0px;
    height: 350px;
    color: #F7F7F7;
    min-width: 1400px;
    width: 100%;
    max-height: 350px;
    text-align: center;
    display: inline-block;
}

#third {
    width: 180px;
    float: left;
    text-align: left;
    margin-left: 10px;
    display: inline-block;
    margin-right: 5px;
}


#first {
    width: 300px;
    float: right;
    overflow: visible;
    margin-right: 10px;
}
#second {
    float: right;
    margin-right: 10px;
    margin-left: 10px;
}

#fourth {
    height: 100%;
clear: none;
padding-left: 10px;
padding-right: 10px;
}

这是HTML

<div class="footer">
 <div id=third>
   <h1>Site Map
   </h1>
     <p1>
     <a href="/index.html">Home page
</a>  <br>
<a href="/estimate.htm">Estimate Form
</a>  <br>  <p1>
<a href="/lawncare.html">Lawn Care Process
</a> <br>
 <p1>
 <a href="/trees.html">Tree And Shrub Control
</a> <br>
 <p1><a href="/pestcontrol.html">Pest Control Services
</a> <br>
 <p1><a href="/sprinkler.html">Lawn Sprinkler ervice </a> <br>
 <p1><a href="/paybal.php">Secure Online Bill Pay
</a>  <br>
 <p1>
 <a href="/careers.html">Careers And Team
</a> 
 <p1>
<br>
 <p1>
 <a href="/testimony.html">Customer Testimony And Lawn Gallery
</a> 
<br>

 </div>
  <div id=first><div itemscope itemtype="http://www.schema.org/LocalBusiness">
    <h1 itemprop="name">Tee Time Lawn Care</h1>
  <br>1566 Frontage Rd
O'Fallon, IL 62269</p1></a>
<br>
    <p1 itemprop="telephone">(618) 632-8873<br>(636) 272-8873</p1>
    <br>
<br>
   <p2 itemprop="description"> A local lawn and landscaping company with an emphasis on safe, organic lawn care. Lawn care companies like us will treat your lawn and yard like a golf course so give us a call if you need the best lawn in your neighborhood. </p2></div>
  </div>
 <div id=second> 
   <h1>Lawn care company service in  Missouri, Illinois (MO, IL)<br>
  St. Louis suburbs including:</h1>
      Fairview Heights lawn care, Fairview Heights landscaping<br>
      St. Louis lawn care, St. Louis landscaping<br>
      Edwardsville lawn care, Edwardsville landscaping<br>
     Granite city lawn care, Granite city landscaping<br>
      Saint Charles lawn care, Saint Charles landscaping<br>
      Belleville lawn care, Belleville landscaping<br>
      Collinsville lawn care, Collinsville landscaping<br>  O'Fallon lawn care, O'Fallon landscaping<br>
      And nearby  towns and cities for your yard service needs.<br><br>

  </div><div id=fourth>
  <h1> Our lawn care and landscaping services include:</h1>
 <p2>Organic and granular fertilization, aeration and seeding, pest control, tree and shrub maintenance service, soil conditioning, heat guard, summer recovery, root rejuvenation, winterizing, blanket barrier, mole removal, yard cleaning, lawn and yard mowing, commercial landscaping, weed removal, weed prevention, vole removal, and more!
 <br> Please contact us for additional services.</p2>
  </div>
  <!-- end .footer -->

</div>
<a href="https://plus.google.com/108985556811751806647" rel="publisher">Google+</a>
</body>

</html>

1 个答案:

答案 0 :(得分:1)

尝试将padding div id中的#fourth更改为以下边距:

margin-right: 20px;
margin-left: 10px;

更新:我创建This Fiddle作为我最新评论的例子。