I’ve tried to set a vertical-align property on the parent container, to no avail.
Hi Scott, Vertical alignment is one of the trickier things about css. First thing to understand is that it only applies to inline elements and tables. The vertical-align property would need to be set on an inline child of the parent and it would only show an effect if it was beside another inline box.
Other things to consider is that line-height will have an effect as well. Generally speaking the default line-height is 1.2, when there is not a unit after the value it is treated as a multiplier. That would be 1.2 X font-size. That is done to make room for text descenders such as the stem of a “p” or a “j”
There is a very simple way that you can achieve your desired result, you could simply lift the sibling block up with a negative top margin. The most accurate way to do that would be with px on both negative margin and font-size of the text above. You may need to set position:relative on the block to layer it above the inline box if it has any BG properties on it.
You can also set a smaller line-height on your text to kill the text descender space along with v-a:bottom. That is normally not recommended but in a case like this where it is just one string of text that does not wrap it would work. I used that in my last example with inline-block.