Welcome to WebmasterWorld Guest from 54.158.238.108

Forum Moderators: not2easy

Message Too Old, No Replies

Remove white space under heading

how is it done?

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

New User

10+ Year Member

joined:Feb 15, 2006
posts:4
votes: 0


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)

Inactive Member
Account Expired

 
 


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

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2004
posts:1497
votes: 0


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.

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 1, 2002
posts:1834
votes: 0


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

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

New User

10+ Year Member

joined:Feb 15, 2006
posts:4
votes: 0


Thankyou very much for your quick answers!
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members