Hi, try to reduce the margin or padding. It would be nice if you posted the css code also. It seems you use the same class for all paragraphs so if you change the top-margin of that class, it will effect all the paragraphs. If we can take a look at the css, there might be a better way to get the effect you want.
Then your “p” tags are getting the default margins and paddings from your browser.
Get rid of those <br> break tags and use some real dummy text if you need something to test with.
Then set up some styles for your p tags in the css and test away.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>margin demo</title>
<style type="text/css">
body {
background: #fff;
font-size:100%;
}
#rightbox {
width:800px;
margin:20px auto;
overflow:hidden;/*contain floats and establish margin clearance*/
background:#EEF;
padding-top:.75em;
}
#rightbox p{
margin:0 .75em .75em;
padding:0;
}
</style>
</head>
<body>
<div id="rightbox">
<p>Lorem ipsum dolor sit amet consectetuer ante iaculis Aliquam dui egestas. Curabitur pede elit
Duis eu cursus eu nec porta gravida at. Orci a vitae et vitae in Vestibulum interdum tincidunt ut
eros. Dolor Nulla Duis Nulla condimentum Vestibulum Vestibulum elit molestie tincidunt vitae. Tortor
ullamcorper id Aenean dui quis.</p>
<p>Risus id sollicitudin diam elit Quisque condimentum vitae laoreet a magnis. Augue tellus orci
Aliquam vitae Vestibulum est gravida consectetuer et tincidunt. Sed tincidunt sit mattis Vestibulum
sed Nam sociis a nibh convallis. Eros auctor tincidunt Quisque wisi felis nibh laoreet orci Sed
Curabitur. Non sagittis Curabitur Nullam Morbi elit Aliquam quis metus Sed ligula. </p>
<p>Phasellus lacinia consequat hendrerit iaculis urna a elit porttitor et tincidunt. Ipsum In at
metus semper semper mollis Sed sed laoreet mauris. Tincidunt condimentum senectus vitae et elit
condimentum In Vestibulum Vestibulum quis. Vitae amet mauris commodo pretium turpis elit ac vitae
lorem dolor. Eget Phasellus Nam justo laoreet lobortis wisi leo non morbi eu. Leo adipiscing
Vestibulum adipiscing lacinia eros In egestas Pellentesque laoreet.</p>
</div>
</body>
</html>
First of all. You have to be more descriptive of the problem that your having.
The way you named your markup could get confusing later down the road. Try to think of your markup as a building block. What are you exactly trying to acheive here? Rayzur, gave a pretty good example. Are you trying to close the gap between the paragraphs with a negetive margin?
EDIT actually, margin:0; works by itself. You have to realise that browsers apply a default margin and padding to paragraphs, and that is all you are seeing, and it shouldn’t take two threads to discover this.