[html] How to align content of a div to the bottom

Here is another solution using flexbox but without using flex-end for bottom alignment. The idea is to set margin-bottom on h1 to auto to push the remaining content to the bottom:

_x000D_
_x000D_
#header {_x000D_
  height: 350px;_x000D_
  display:flex;_x000D_
  flex-direction:column;_x000D_
  border:1px solid;_x000D_
}_x000D_
_x000D_
#header h1 {_x000D_
 margin-bottom:auto;_x000D_
}
_x000D_
<div id="header">_x000D_
  <h1>Header title</h1>_x000D_
  Header content (one or multiple lines) Header content (one or multiple lines)Header content (one or multiple lines) Header content (one or multiple lines)_x000D_
</div>
_x000D_
_x000D_
_x000D_

We can also do the same with margin-top:auto on the text but in this case we need to wrap it inside a div or span:

_x000D_
_x000D_
#header {_x000D_
  height: 350px;_x000D_
  display:flex;_x000D_
  flex-direction:column;_x000D_
  border:1px solid;_x000D_
}_x000D_
_x000D_
#header span {_x000D_
 margin-top:auto;_x000D_
}
_x000D_
<div id="header">_x000D_
  <h1>Header title</h1>_x000D_
  <span>Header content (one or multiple lines)</span>_x000D_
</div>
_x000D_
_x000D_
_x000D_

Examples related to html

Embed ruby within URL : Middleman Blog Please help me convert this script to a simple image slider Generating a list of pages (not posts) without the index file Why there is this "clear" class before footer? Is it possible to change the content HTML5 alert messages? Getting all files in directory with ajax DevTools failed to load SourceMap: Could not load content for chrome-extension How to set width of mat-table column in angular? How to open a link in new tab using angular? ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

Examples related to css

need to add a class to an element Using Lato fonts in my css (@font-face) Please help me convert this script to a simple image slider Why there is this "clear" class before footer? How to set width of mat-table column in angular? Center content vertically on Vuetify bootstrap 4 file input doesn't show the file name Bootstrap 4: responsive sidebar menu to top navbar Stylesheet not loaded because of MIME-type Force flex item to span full row width

Examples related to vertical-alignment

How to center div vertically inside of absolutely positioned parent div Bootstrap how to get text to vertical align in a div container How to vertically center a container in Bootstrap? vertical align middle in <div> Vertically align an image inside a div with responsive height Why is width: 100% not working on div {display: table-cell}? Align text to the bottom of a div How to display list items as columns? Add vertical whitespace using Twitter Bootstrap? vertical alignment of text element in SVG