Forum Moderators: open

Message Too Old, No Replies

Get Rid Of H1 Trailing Linebreaks?

         

Technel

12:52 am on Jan 20, 2004 (gmt 0)

10+ Year Member



Hi,

I was wondering if it was possible to get rid of the trailing linebreaks after the H1 tag.

For example,

<h1>Article Title</h1>
Article Preview

Would give you:

Article Title

Article Preview

I want the "Article Preview" to be right after the "Article Title." Does anyone know if this is possible, and if so, how can I get rid of these linebreaks?

oilman

1:00 am on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It can be done with CSS. Try this thread:
[webmasterworld.com...]

Welcome to WebmasterWorld :)

Krapulator

1:09 am on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Quick Answer:

<h1 style="display:inline;">Article Title</h1><br />
Article Preview

Will give you:

Article Title
Article Preview

Birdman

1:29 am on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



h1{margin: 0} // zero margin in all directions
or
h1{margin: 5px} // 5 pixel margin in all directions
or
h1{margin: 0 10px} // no margin above and below...10 pixel on each side
or
h1{margin: 10px: 0} // 10 pixel margin above and below..none on the sides
or
h1{margin: 1px 2px 3px 4px} // all four sides in order(top,right,bottom, left)

I am not aware of padding being added automatically(to <h> tags), so that should not be an issue.

Using display: inline; with a <br/> is really not the cleanest solution. Kind of defeats the purpose of CSS.

Note: Always include the measuring operator(ie. px, em, pt), unless the value is zero(0).

Technel

10:53 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



Exactly what I wanted! Thanks a lot.

-Technel