Having a problem with padding and margins in div tags

October 22nd, 2007 · No Comments

Janine,

I have your Dreamweaver CS3 Essentials DVD and went through the entire thing. I loved it! I’m a beginner and the pace was perfect. I have one problem and it may be a software problem.

When adjusting the padding and margins of my divs there is often no effect. If I delete the div and it’s id style and then recreate everything, it works. This happens often and I find myself completing parts of my layout and then having to delete everything and start over again. It usually works the second or third time. I also have noticed that when creating editable regions in my template file that the div seems to extend upwards and create a line or two of space that I can’t edit. For example. I created a header, and nav bar and then a body section for the content. I made the body section editable. I copied text from Microsoft Word and pasted it into the body of an index page. When adjusting the padding, the sides and bottom work but the padding at the top takes no effect. I have a feeling that I will have to delete and recreate things again as this has worked in the past but it’s getting annoying to repeat my work over and over. Maybe you have heard about divs acting this way before.

Thank you for the time. I am sure you get about 300 of these emails a day.

Chris Thornham

Hi Chris,

Thanks for your kind words about my videos. I do try to answer questions, but you’re right, sometimes it’s hard to keep up.

I have found some strangeness in Dreamweaver like you describe, especially when using Dynamic Web Templates with CSS. Instead of recreating the page, you may be able to just close the page and reopen it, or close the program and restart it to resolve the problem. Sometimes Dreamweaver has display problems.

As for as strange spacing, trust the browsers more than Dreamweaver. Sometimes when you create an editable region Dreamweaver adds some extra space, but when you preview the page in a Web browser, you can see that the space is not really there.

And here are two other tips: You can’t preview a .dwt page in Internet Explorer, but you can in Firefox. And, Firefox and IE don’t always display padding the same way so you may have to settle from slight differences from browser to browser or learn to do very advanced CSS workarounds to ensure the pages display exactly the same.

I hope that helps and I wish you all the best with your Web pages,

Janine

Tags: CSS · Dreamweaver 8 · Dreamweaver CS3 · Templates

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.