# Quick CSS Page Margins ?uestion

**URL:** <https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117>\
**Category:** Uncategorized\
**Created:** [July 19, 2004, 10:51pm UTC](https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117 "2004-07-19T22:51:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GOLGO\_13](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@GOLGO\_13](https://forum.kirupa.com/u/GOLGO_13)\
**Post date:** [July 19, 2004, 10:51pm UTC](https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117/1 "2004-07-19T22:51:13Z")

</div>

\*\*hey! \*\*  
i’ve got a linked style sheet thats not acting the way i want it too. i want to set all the page marigins to zero and added the following code to my style sheet:

```auto
 <style> 
 
body
{ 
 margin-top: 0px; 
 margin-bottom: 0px; 
 margin-left: 0px; 
 margin-right: 0px 
}

p
{ 
 background: yellow; 
 font-family: courier 
}

 
</style>

```

now… the **\< p \>** styles are working just fine… so i must be doing something wrong, or using the wrong code to effect the page margins. what do i need to do differently? \*\*thanks! :block: \*\*

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 10:56pm UTC](https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117/2 "2004-07-19T22:56:40Z")

</div>

first, you should use margin: 0px; rather than defining each seperately, it’s also good to set padding to 0 at the same time though. And I don’t understand what’s the problem, you’re saying because it works you did something wrong?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 11:10pm UTC](https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117/3 "2004-07-19T23:10:58Z")

</div>

> [@bombingpixels](#):
>
> first, you should use margin: 0px; rather than defining each seperately, … And I don’t understand what’s the problem, you’re saying because it works you did something wrong?

yeah… i should have been a bit more clear. the styles for the \< p \> were working… but not the \< body \> styles. after some further investigation, i noticed that dreamweaver didnt seem to list the body styles in the Design/CSS Styles window. but for some reason when i wrote it like this:

```html
 <style> 
body
{ 
 margin-top: 0px; 
 margin-bottom: 0px; 
 margin-left: 0px; 
 margin-right: 0px;
 font-family: courier 
}
P 
{ 
 background: yellow; 
 font-family: courier 
}
 
body
{ 
 margin: 0px;
 font-family: courier 
}

</style>

```

it seemed to work just fine: no page margins, and the design window in dreamweaver saw the **second** body style code. it still wasnt showing the first.

**thanks for the margin suggestion!** dont know why dreamweaver doesnt like my first body style… but at least it seems to be working the way i want now! but…

is something about the way the first body style is written wrong? why doesnt dreamweaver, or IE seem to recognize it? i dont see why the first body style doesnt work, and the second body style does? any thoughts? if not… oh well. its working fine now. thanks for the response!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 11:13pm UTC](https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117/4 "2004-07-19T23:13:27Z")

</div>

I have no idea why that isn’t working, it should be, anyways, ie isn’t any good and that’s probably why it doesn’t like it :P, but not sure about dreamweaver

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 11:21pm UTC](https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117/5 "2004-07-19T23:21:11Z")

</div>

hmmm… from what i can tell… dreamweaver doesnt seem to like or recognize the first stlye listed. **whatever it is.** might be some sort of strange bug… or maybe i’m doing something stupid… oh well… i dont care anymore… i’ve got a working solution. 😉

again, thanks for taking the time to help me out with the question.

later…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 19, 2004, 11:23pm UTC](https://forum.kirupa.com/t/quick-css-page-margins-uestion/58117/6 "2004-07-19T23:23:59Z")

</div>

np 😉
