Support » Themes and Templates » Want to have Blog title and description side-by-side in header

  • Resolved David Borrink

    (@davidborrink)


    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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    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.

    Doodlebee,

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Want to have Blog title and description side-by-side in header’ is closed to new replies.