Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop linebreak after a heading tag eg. <H1> 1

Status
Not open for further replies.

Brawn

Programmer
Jul 5, 2001
73
0
0
CA
Is there any way to stop a line break after a Heading tag
I've tried things like:

H3{break-after:never}

I don't know. 8o(
any thoughts, Brawn

"My mind is my Shrine,
and my body the Temple around it."

-The difference between genius and stupidity is that genius has its limits-
 
The only way I know how to do it is to bypass the heading tag(s) and just manipulate the text using font attributes.

[noevil]
 
use a span tag instead of a header. here is a way you could do it :

<style>
.h1 { font-size:16px ;}
.h2 { font-size:14px ;}
.h3 { font-size:12px ;}
</style>

<span class=h1>this would work like an H1 without the line break</span>
<span class=h2>this would work like an H2 without the line break</span>
<span class=h3>this would work like an H3 without the line break</span>

Hope this helps. Gary Haran
 
The header tags are block elements. Change their display property to inline and they will not break afterwards:

h1 { display: inline; }

If you just want no space after the first line break, change the bottom margin to 0px:

h1 { margin-bottom: 0px; }
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top