代码之家  ›  专栏  ›  技术社区  ›  Himanshu Poddar

在materialize中将文本移到页脚内部上方

  •  0
  • Himanshu Poddar  · 技术社区  · 6 年前

    我有一个物化页脚的高度,我已经设置为35像素。但问题是页脚中的文本消失了。当它离开屏幕时,当我减小页脚的大小时,我如何将它向上移动

      <footer style="position:fixed;bottom:0;left:0;width:100%;" class = "page-footer">
    
     <div class = "footer-copyright">
    
        <div class = "container">
           © 2016 Copyright Information
           <a class = "grey-text text-lighten-4 right" href = "#!">Designed & Developed by XYZ</a>
        </div>
     </div>
    

    enter image description here

    现在,当我应用CSS来缩小页脚的大小,并将容器中的文本向上移动时,我得到了。

        footer {
           height: 35px;
        }
        footer .container {
           margin-bottom : 50px;
        }
    

    enter image description here

    文本已显示,当我尝试将文本容器向上移动时,它不起作用。

    我怎样才能解决这个问题,我哪里做错了。

    注:我尝试了所有的答案,我得到的建议,但没有一个适合我。

    0 回复  |  直到 6 年前
        1
  •  1
  •   decabeza    6 年前
    footer .container {
      margin-bottom: 50px;
    }
    

    这不管用,因为 .container footer 有固定的高度。

    为避免文本消失,您可以尝试使用相同的值向页脚添加一行高度:

    footer {
      height: 35px;
      line-height: 35px;
    }
    

    footer {
      height: 35px;
      line-height: 35px;
      padding-bottom: 50px;
    }
    

    ;)

    推荐文章