WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Want to have Blog title and description side-by-side in header (4 posts)

  1. David Borrink
    Member
    Posted 8 years ago #

    Hello,

    I would like to put the Blog title and the description text side by side in my header. Right now the description line appears on a line below the Title. I look at my header code and this is what I find:

    <h1>"><?php bloginfo('name'); ?></h1>
    <h2><?php bloginfo('description'); ?></h2>

    So I get a hyperlinked title to my blog, then right below it is my description line. The What I don't see in the above code is a <br> or anything else that tells the page to display the two items as separate lines. If there was a <br> or something like that, I'd just delete it and have it all on one line, or so I would think.

    So, what I want is to have my blog title on the left of my page, and the description to the right in smaller text. I have the styles set up correctly. I just need the positioning trick. Anyone have a suggestion? Thanks!

  2. David Borrink
    Member
    Posted 8 years ago #

    Okay, the example above didn't show the code the way I pasted it in. The first line should have an A tag around the example, but it shows above as a hyperlink ready to use. Just imagine an A tag involved on the first line.

  3. Doodlebee
    Member
    Posted 8 years ago #

    You *won't* see a "br" tag to separate lines in h1 and h2 elements, because they are block-level elements. Which means that, anytime you use one of these tags, they take up the entire line they rest, and push everything after it to the next line.

    If you change your stylesheet to:

    h1, h2 {
    display:inline;
    }

    for starters, that may help. But you also may have to float one fo the elements to get your h2 to line up right next to your h1 - but then again you might not.

  4. David Borrink
    Member
    Posted 8 years ago #

    Doodlebee,

    That was exactly what I needed. The diplay:inline tag did the trick. Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic