【问题标题】:HTML: I want to position this paragraph text to bottom of my page?HTML:我想将此段落文本放置在页面底部?
【发布时间】:2013-08-02 03:10:15
【问题描述】:

目前文本位于我网站的顶部,但我希望它位于底部;

 <p style="text-align:relative;">this is best day ever!this is best day ever!this is best day ever!<p> 

当我编辑它并添加 text-align:bottom 时它会起作用!!!

【问题讨论】:

    标签: css html paragraph


    【解决方案1】:
     <html>
            <head>
                <title>test</title>
            </head>
            <body>
                <div style="display: table;">
                    <p style="display: table-row;vertical-align: bottom; text-align: center"> TEXT YOU WANT
                    </p>
                </div>
            </body>
        </html>
    

    我在这个问题中找到了它,http://stackoverflow.com/questions/526035/how-can-i-position-my-div-at-the-bottom-of-its-container/19110204#19110204Hashbrown回答

    【讨论】:

      【解决方案2】:
      p {
          height:200px;
          display: table-cell;
          vertical-align: bottom;
      }
      

      这是一个更好的方法...

      【讨论】:

        【解决方案3】:

        试试这个代码:

          <html>
                <head>
                    <title>test</title>
                </head>
                <body>
                    <div style="position: relative">
                        <p style="position: fixed; bottom: 0; width:100%; text-align: center"> TEXT YOU WANT
                        </p>
                    </div>
                </body>
            </html>

        【讨论】:

          【解决方案4】:
           <p id="Bottom">this is best day ever!this is best day ever!this is best day ever!<p> 
          

          和 CSS :

          #Bottom {
             position : absolute;
             bottom : 0;
          }
          

          Demo

          【讨论】:

            【解决方案5】:

            绝对定位元素并将其底部属性设置为0。

            p{
                position: absolute;
                bottom: 0;
            }
            

            工作示例 http://jsfiddle.net/zMKbf/

            【讨论】:

              【解决方案6】:

              试试这个:

              style="position:absolute; bottom:0px;"
              

              【讨论】:

                猜你喜欢
                • 2019-09-30
                • 2017-02-12
                • 1970-01-01
                • 1970-01-01
                • 1970-01-01
                • 2023-03-02
                • 1970-01-01
                • 2013-12-02
                • 2015-02-16
                相关资源
                最近更新 更多