tags:

views:

73

answers:

3

I'm trying to place normal size text on the same line as a header tag. Doing this put the normal size text on the next line because a header tag is a block element.

<h1>Header</h1>normal size text

Any help is much appreciated.

+5  A: 
h1{display:inline;}

Will cause the H1 Tag to stop blocking

Quintin Robinson
But it doesn't work on IE6, moves it to the next line, any tips? I know IE6 must die but until it does, I need to fix it.
Bob
`h1{display:inline;}` and `<h1>Hello There</h1>You Crazy World` Worked fine for me on IE6.. are there any other styles being applied? If you are unsure you can try `h1{display:inline !important;}`
Quintin Robinson
You are right, your code works in IE6 but there are a bunch more other styles in play, I need to sort out the offending one, thanks.
Bob
@Bob, you may want to use a CSS-reset stylesheet to remove the browser defaults and style the elements you need. See: http://stackoverflow.com/questions/116754/best-css-reset for a discussion of some of the available options.
David Thomas
A: 

Or, if you don't want to use inline elements, float the h1 instead:

h1 {
    float:left;
}

In some scenarios may need to wrap both the h1 and normal size text in a div, that's also floated left, to keep it contained on the same line:

<div id="foo"><h1>Hello</h1>World</div>
Jon Hadley