I'm trying to get a title style working, and am wondering if there's a clever way to do it that I'm missing. I've attached an image to demonstrate, but what I basically want to do is take some heading text and drop one or more words to just below the baseline, while actually displaying a bottom border that "splits" the two.
Visually, the result is one word above a line and the next below.
Now, I could get this working easily enough with a two-line heading and a bunch of custom positioning, but I'm trying to figure out some clever way of doing it with nothing but a single h1 tag and one or more spans to move the text up/down, something like this:
This is so the page degrades well and makes sense semantically, and also because if it's all on one line I don't need to worry about getting the lower words spaced horizontally past the upper ones, just the vertical position.
I was thinking that, similar to some ways of getting linespacing consistent with superscripts, the vertical-align property combined with line-height: 0; would do this. But, while I can move text down with a vertical-align: -100% or somesuch, if I set a line height it refuses to move down past that setpoint, and if I don't it just pushes the bottom border of the containing h1 element, so the horizontal line is in the wrong place.
vertical-align: sub; does what I want (drops text through the bottom border), but of course it's only about 1/4 of a word drop, not a full character height.
Am I overlooking something, or is this just not going to work?
Visually, the result is one word above a line and the next below.
Now, I could get this working easily enough with a two-line heading and a bunch of custom positioning, but I'm trying to figure out some clever way of doing it with nothing but a single h1 tag and one or more spans to move the text up/down, something like this:
Code:
<h1>Word1 <span>Word2 Word3</span></h1>
I was thinking that, similar to some ways of getting linespacing consistent with superscripts, the vertical-align property combined with line-height: 0; would do this. But, while I can move text down with a vertical-align: -100% or somesuch, if I set a line height it refuses to move down past that setpoint, and if I don't it just pushes the bottom border of the containing h1 element, so the horizontal line is in the wrong place.
vertical-align: sub; does what I want (drops text through the bottom border), but of course it's only about 1/4 of a word drop, not a full character height.
Am I overlooking something, or is this just not going to work?