Welcome to WebmasterWorld Guest from 54.226.25.231

Forum Moderators: not2easy

Message Too Old, No Replies

Remove white space under heading

how is it done?

     

Webbies

4:58 pm on Feb 18, 2006 (gmt 0)

5+ Year Member



I want to have

Some heading
some text blah blahbla

and not

Some heading

some text blah blahbla

how do I get rid of the white space?

also, is it possible to get rid of the line break so the heading is displayed like this:

Some heading: some text blah blahbla

p_antoni

5:08 pm on Feb 18, 2006 (gmt 0)



to remove the white space just add "margin: 0px" to your CSS style for the heading

you can remove the line break by adding "display: inline"

Hope this helps

Robin_reala

5:12 pm on Feb 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld!

Adjusting the margins in CSS. You'd want to do something like:

h1 { margin-bottom: 0; }
p { margin-top: 0; }

<p> elements in strict mode (at least in Firefox) have margins on the top as well so you'll want to remove them.

To answer your secoding question, the ideal solution would be:

h1 { display: run-in; }

This should make the <h1> element (according to the specs [w3.org]) become the first inline element of the following <p>. Unfortunately full support is limited to Opera, and limited support to Safari and IE5/mac. You might be able to simulate the effect by making both the <h1> and the following <p> inline but I'm not sure how well that'd work.

willybfriendly

5:42 pm on Feb 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



display: run-in; lacks sufficient suppport to be reliable.

For run-in headings I generally use...

<h1 style="display: inline; margin-right: .5em;">Some text</h1><p style="display:inline">some more text...</p>

which works in IE, Moz, Opera etc.

WBF

Webbies

6:29 pm on Feb 18, 2006 (gmt 0)

5+ Year Member



Thankyou very much for your quick answers!
 

Featured Threads

Hot Threads This Week

Hot Threads This Month