Three possible solutions, although each has its own reservations.
jsFiddle demo
The first solution relies on line-height: 220px; vertical-align: bottom; line-height: 220px; vertical-align: bottom; to align the text with the bottom of the DIV . The second solution creates :before psuedo element, which pushes the text to the bottom of the DIV (this does not require additional markup). Both solutions will fail in IE7 or earlier, and both will have problems if:
- Change font size
- Text wraps in the second line
- The size of the change in the containing item
The third solution is based on the display: box; property display: box; , which is a CSS property that is phasing out (more details in Quick hits using a flexible box model ). This solution is only supported by Chrome from v4, Firefox from v2 and IE10. However, the new Flexbox standard is standardized, but browser support is minimal. This solution can be considered "too new" for effective use ( html5please.com/#flexbox ).
Generally speaking, you should consider a new wrapping element around your text that will allow position: absolute; bottom: 0; position: absolute; bottom: 0; Simplify an element to the bottom of the parent element. This makes it possible to increase the child element up as the font size or text length increases and does not depend on the size of the parent container. Depending on how important your position is to your layout, you can add this new element using Javascript. This is probably not ideal, given the question you asked, but browser support is no less ideal for the crazier CSS solutions listed above :-p
source share