- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
What is the preferred method for splitting an H tag into two lines? I kind of like the following method, but I don’t really like adding tags just for styling.
[CodePen Example](http://codepen.io/msguerra74/pen/qFtke “”)
You would be better off using the <br>
tag.
True, but I was thinking about being able to style the second line separately also.
Then might it not make more sense to do:
<h1>Main Title</h1>
<h2>Differently styled sub title</h2>
I thought about that too, but I wanted the h1 to be a single sentence when styles are turned off, or if the document gets printed. I wish there was a way to target the text after the br tag, but I can’t think of a way.
Use a span and set it to display: block.
That’s what I was doing originally, but was trying to accomplish a similar thing without adding the extra span markup. I’m thinking that’s probably the best solution though.