WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Pages wont display <br /> (7 posts)

  1. dannyh
    Member
    Posted 9 years ago #

    I want to put some space in between a h1 and h2 element that is directly below it and since IE is not compatibel with h1+h2 that utilizes margin space, I just want to us br tags.

    When I do this:

    <h1>Title</h1>

    <h2>Subtitle</h2>

    WordPress strips the br tags out of it. What are my options?

    thanks

  2. oriecat
    Member
    Posted 9 years ago #

    Are you putting this in the page template or in the actual page content?

  3. dannyh
    Member
    Posted 9 years ago #

    In the page content.

  4. Lorelle
    Member
    Posted 9 years ago #

    IE and all browsers allow you to add space to your H1 and H2 and all the rest. Add the "space" in your CSS.

    h1 {margin:5px 10px 20px 5px; padding: 3px 4px 5px 6px;......}

    Don't try to force it in with line breaks. It's....messy.

    Wait, are you using the H1 and H2 heading in your page content? If you are using a WordPress Theme (not your own design), these two headings are reserved for special places, so any changes you make to them in the CSS will be found everywhere on every page.

    If you want to have headings in your post, try H3, H4, or even H5 within the content. Then you will have exacting control on these and they won't impact your blog header and such.

  5. dannyh
    Member
    Posted 9 years ago #

    I created my own theme.

    I didnt want to have to resort to creating a new class or a h3-h5 since that is semanticly inccorect. It is the top level heading, which would be an h1. It is not a 3rd to 5th level heading which would no make sense to use it in that application.

    The h1 is displaying fine, and so is the h2 according to my stylesheet (no its not a default stylesheet).

    I feel it would be even messier adding another class for the h1 or h2 elements just to get a little extra room when an h2 is directly after a h1 element.

    I want a line break, which wordpress wont display.

    Regardless, the issue is that WordPress is stripping away
    tags which is should not if I put them in.

    Does WordPress do this for everyone, or is something else?

  6. Lorelle
    Member
    Posted 9 years ago #

    Technically the following is "wrong", though, this is a matter of perspective.

    <h1>Blah Blah</h1><br />
    <h2>Little Blah</h2><br/ >

    Spaces like that are controlled by the CSS. Why can't you put a margin or padding in it?

  7. dolmarit
    Member
    Posted 9 years ago #

    <h1>Title</h1>
    <div> & nbsp ; </div>
    <h2>Subtitle</h2>

    Remove the spaces

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.