<div style='height:200px; float:left; border:1px solid #ff0000; position:relative;'> <span style='position:absolute; bottom:0px;'>A Text</span> </div>
效果是,在FF我只是得到垂直线(div以折叠的方式),文本写在它旁边。如何防止div折叠,但宽度适合文本?
Demo
div { display: table-cell; vertical-align: bottom; border: 1px solid #f00; height: 100px; width: 100px; }