html - 将文本固定到页脚

标签 html css

<分区>


想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post .

关闭 9 年前

正如您在图片中看到的那样,右侧的链接没有正确固定到我的页脚 我应该怎么做才能使其正确? 我不知道为什么这两个部分之间我的意思是 div 链接我有很大的距离 我也不希望他们之间有这种距离。

我在页脚中插入了样式和表格。 提前致谢

enter image description here 如果需要样式:

    <style>
#footer{
    background-image:url(../images/footer.png);
    background-position:inherit;
    background-repeat:no-repeat;
    width:100%;
    height:150px;
    margin:0
    auto;
    text-align: right;
    }
    #links ul {
            list-style-type: none;
            width: 400px;
            float:right;
                text-align: right;
    } 

    #links li {
            border: 1px dotted #999;
            border-width: 2px 0;
            margin: 5px 0;
            float:right;
                text-align: right;
    }

    #links li a { 
            color: #FF6600;
            display: block;
            font: bold 120% Arial, Helvetica, sans-serif;
            padding: 5px;
            text-decoration: none;
            float:right;
            text-align: right;

    }

     * html #links li a {  /* make hover effect work in IE */
        width:600px;
        float:right;
            text-align: right;
    }

    #links li a:hover {
            background: #FFFFFF ;
    }

    #links a em { 
            color: #333;
            display: block;
            font: normal 85% Verdana, Helvetica, sans-serif;
            line-height: 125%;
            float:right; 
            text-align: right;
    }

    #links a span {
            color: #125F15;
            font: normal 70% Verdana, Helvetica, sans-serif;
            line-height: 150%;
            float:right;
    }
    </style>

页脚和文本:

   <div id="footer">
<table width="100%" height="183" align="left" cellpadding="0" dir="ltr">
<tr>
<td width="30%">
 <div id="links">
    <ul>
      <li><a href="#" title="لینک">سرویس های مشتری
       <table width="100%">
        <tr>
        <td width="337" cellpadding="0"><em>ارتباط با ما</em></td>
        </tr>
        <tr><td> <em>ثبت نام</em></td></tr>
        <tr><td> <em>پرسش و پاسخ</em></td></tr>
        </table>
        </a></li> 
    </ul>
  </div> 

  </td>
 <td width="40%">
 <div id="links">
    <ul>
      <li><a href="#" title="لینک">لینک های مفید
        <table width="100%">
        <tr><td width="337">
        <em>لینک یک</em></td></tr>
        <tr><td>
         <em>لینک دو</em>
         </td></tr>
          <tr><td>
         <em>لینک سه</em>
         </td></tr>
         </table>
        </a></li> 
    </ul>
  </div> 
  </td>
   <td width="30%">
 <div id="links">
    <ul>
      <li><a href="#" title="لینک">اخبار
        <table width="100%">
        <tr><td width="337">
        <em>خبر یک</em></td></tr>
        <tr><td>
         <em>خبر دو</em>
         </td></tr>
          <tr><td>
         <em>خبر سه</em>
         </td></tr>
         </table>
        </a></li> 
    </ul>
  </div>
  </td>
  </tr>
  </table>
</div>

最佳答案

所以,让里面表格的宽度为#footer 100%。 &相应地划分<td>的宽度百分比。

实际填充到#footer将最后一个表格行推到外面,因为填充增加了 #footer 的宽度所以宽度设为#footer960px因为应用的填充在左右两侧为 20px。

关于html - 将文本固定到页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11644876/

上一篇:css - 在绝对定位的 div 中居中 div

下一篇:jquery - 调整浏览器大小时的导航菜单宽度

相关文章:

php - 悬停时提交按钮不起作用

html - Firefox CSS 错误(在 Chrome 中工作正常)

CSS:定位问题

html - 如何防止一个div元素被另一个div元素的box-shadow影响?

html - 如何使文本在 CSS 中创建的框下对齐

javascript - 如何获得访问 token Spotify API?

javascript - WebView 和浏览器在 HTML/JavaScript 解析上的区别

html - CSS:背景图像/颜色和容器不会在移动设备上拉伸(stretch)全宽

html - CSS - 响应式设计的 float 问题

css - Firefox 中的定位问题?位置 :relative for a display:table element