Can I use vertical-align
(I realise this only applied to text - but I want to align text (albeit within a nested element)) to position the text in the following DOM at the bottom of an ancestor element?
I know how to do it with position: absolute
, but can it be done with vertical-align?
The span inside the h1
is needed for a text-background effect.
#bar {
background-color: rgb(236 , 154, 46 );
vertical-align: middle;
display: inline;
}
h1 {
font-size: 2.6rem;
line-height: 2.8rem;
text-transform: uppercase;
}
#foo {
background: url(https://d3i6fh83elv35t.cloudfront.net/newshour/wp-content/uploads/2017/07/scaramucci-1-1024x703.jpg);
background-size: cover;
min-height: 400px;
}
<header id="foo">
<h1>
<span id="bar">i want this aligned to the bottom of the header</span>
</h1>
</header>