Put text at bottom of div

前端 未结 5 1645
灰色年华
灰色年华 2020-12-02 07:10

I have 4 DIV\'s right next to each other, and they\'re all centered in the middle of the screen. I have 2 words in each div, but I don\'t want them at the top, I want them t

5条回答
  •  清歌不尽
    2020-12-02 07:39

    Two Words
    Two Words
    Two Words
    Two Words
    #container{ width:450px; height:200px; margin:0px auto; border:1px solid red; } #container div{ position:relative; width:100px; height:100px; border:1px solid #ccc; float:left; margin-right:5px; } #container div span{ position:absolute; bottom:0; right:0; }

    Check working example at http://jsfiddle.net/7YTYu/2/

提交回复
热议问题