簡體   English   中英

如何在div中垂直對齊?

[英]How to vertical align in a div?

我不知道如何對齊當前在標題的左上方的文本,使其出現在底部 任何建議將不勝感激:

這是現在的樣子:

在此處輸入圖片說明

這就是我想要的樣子:

在此處輸入圖片說明

這是我到目前為止的代碼:

        <div id="header_container">
           <div id="subheader-left" style="float:left; width:50%; text-align:left">chilun liu</div>
              <div id="subheader-right" style="float:right; width:50%; text-align:right">
    <!-- the Social Network's images  -->  
              </div>         
           </div>
        </div>

將此添加到您現有的CSS

#subheader-left,#subheader-right{
 display:table-cell;
 vertical-align:bottom
}

側面說明: IE8及更高版本支持此解決方案...

另外

style="border:none; width="40" height="40"

應該

style="border:none; width:40px; height:40px"
                      /*  ^^ no "=" sign or quotes,instead, 
                         semi colon and values only */

嘗試,

#subheader-left { position: absolute; bottom: 0; left: 0; }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM