By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,985 Members | 1,712 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,985 IT Pros & Developers. It's quick & easy.

Remove the space before a paragraph

P: 6
I am new to CSS and have spent many unsuccessful hours trying to find a way to remove the space above the beginning of a paragraph. What I want to do is to have a bold heading <H3> in 12pt followed immediately on the next line by text in normal 10pt. I'm sure there is a simple answer that escapes me but how do I do it?
Oct 5 '06 #1
Share this Question
Share on Google+
7 Replies


drhowarddrfine
Expert 5K+
P: 7,435
To remove the margin, just put margin:0 in your css for both elements.
Oct 5 '06 #2

P: 6
Thank you for your response. That's exactly what I tried but got not result - still have space above and below. ??
Oct 6 '06 #3

P: 6
Is this correct - in my style sheet?
P.nospace { margin-top:0;
margin-bottom:0;
padding:0;
margin-left:50px;
font-family:Arial, sans-serif;
font-size:10pt;
color:white }

In the text: <P class="nospace">Text of paragraph</P>

Thanks for your help.
Oct 6 '06 #4

P: 16
Just like in a book, a paragraph is given a new line

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent luctus. Sed eget nulla. Proin erat velit, porttitor vitae, laoreet vel, facilisis et, nisi. Fusce id neque eu est lacinia venenatis. Vivamus nec dolor nec purus placerat tincidunt. Fusce erat. Nunc imperdiet suscipit risus. Pellentesque mauris. Vivamus ligula. Morbi bibendum convallis lacus. Etiam mi. Morbi eget pede nec velit fringilla posuere. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc risus.
paragraph break
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent luctus. Sed eget nulla. Proin erat velit, porttitor vitae, laoreet vel, facilisis et, nisi. Fusce id neque eu est lacinia venenatis. Vivamus nec dolor nec purus placerat tincidunt. Fusce erat. Nunc imperdiet suscipit risus. Pellentesque mauris. Vivamus ligula. Morbi bibendum convallis lacus. Etiam mi. Morbi eget pede nec velit fringilla posuere. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc risus.


To have it just move onto another line, you use <br> for a BREAK and not a new paragraph =)
Oct 7 '06 #5

P: 6
Sorry, perhaps I haven't made it clear. I know about <BR> but what I want to do is to follow text immediately after <H3>Heading</H3> i.e. not have space before the line that follows and it should not be bold and be a smaller font as specified in the style sheet. All text and headings are white on a maroon background. Thanks
Oct 7 '06 #6

ronverdonk
Expert 2.5K+
P: 4,258
To simplify it:

[HTML]

<h3 style="margin:0;line-height:12pt;font-size:12pt;">Hello there</h3>
<p style="margin:0;font-size:10pt;line-height:10pt">and to you too</p>

[/HTML]

Ronald :cool:
Oct 7 '06 #7

P: 6
Thanks, all, for the help. Success!
Oct 10 '06 #8

Post your reply

Sign in to post your reply or Sign up for a free account.