PDA

View Full Version : extra margins in Opera browser


Rosanna
06-05-2005, 12:00 PM
Help!

I am a real beginner with beginner problems! I can't seem to get around this one. In dreamweaver I have set all four margins to "0" in Page Properties. This creates an internal style sheet for the document. When I insert some content (aligned just in the top-left corner) there is still a gap (margin) in the top of the page as well as in the left of the page. This happens only in Opera (Windows xp). Navigator and Exprorer are OK. This problem is easy to see as I have set a background image as well and these two (BG image and the content image) won't align nicely.

:( Rosanna

kate
06-05-2005, 01:04 PM
Hya,
I do believe a member at mine had this problem..

Try this:

<HTML>
<HEAD>
<TITLE>Zero Page Margins</TITLE>
<META NAME="generator" CONTENT="NoteTab">
<script>
function zeroBorders(){
theDom = dreamweaver.getDocumentDOM()
theBody = theDom.getElementsByTagName("BODY")
theBody.item(0).setAttribute("marginwidth","0")
theBody.item(0).setAttribute("marginheight","0")
theBody.item(0).setAttribute("topmargin","0")
theBody.item(0).setAttribute("leftmargin","0")
}

</script>
</HEAD>
<BODY onload=zeroBorders()>

Zero Page Margin Borders
</BODY>
</HTML>


:)

Rosanna
06-05-2005, 01:32 PM
Thanks Kate!

Is it so that this problem with Opera aligning content wrong is fixed only with some additional scripting?

Why is this happening, is this a problem caused by Dreamweaver? First I thought that the problem is <style>-tag and that Opera doesn't support CSS styles but this of course is not true.

I am awfully sorry about my English! These problems are just too much for a beginner with lousy English....

Rosanna :( :(

ranjan
06-05-2005, 06:45 PM
theDom = dreamweaver.getDocumentDOM()

The above javascript is dreamweaver API specific. It is used by extension developers for extension building!

Please do NOT use the above code on web pages.

Rosanna, please link to your page for us to look into the issue

Rosanna
06-05-2005, 07:37 PM
ranjan,

I just found the solution. I was missing padding in the <body> element. Evidently Opera needs that.

rosanna :lol:

kate
06-06-2005, 01:45 PM
Great to hear you are now sorted Rosana,

ranjan, are you not now moderator at 'India mug forums as you hav'nt posted since last july? no one seems to do a lot there which is a shame?


:)