Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Line breaking H tags

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #40361
    Anonymous
    Inactive

    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 “”)

    #112158

    You would be better off using the <br> tag.

    #112161
    Anonymous
    Inactive

    True, but I was thinking about being able to style the second line separately also.

    #112220

    Then might it not make more sense to do:

    <h1>Main Title</h1>
    <h2>Differently styled sub title</h2>
    #112237
    Anonymous
    Inactive

    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.

    #112238
    Kitty Giraudel
    Participant

    Use a span and set it to display: block.

    #112241
    Anonymous
    Inactive

    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.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.