Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting margins within a new pop-up window

Status
Not open for further replies.

canix

Technical User
Jun 1, 2000
41
0
0
US
This must seem major wussy-code-writer here... but I goota know and I couldn't find another thread with this topic.

I want to set the actual margin width and height between the fram and contence within a web page. My problem is that when I go to open this pop-up window.. I want the window frame and all to wrap around the contence without giving me a thick line of white in margin area and off setting my whole effort...

I could just set the background black and it would look sucky... but I want to learn something this time..

I am sure this is something plain and stupid that I just missed in the HTML ... But I just can't find anything solid....

Tahnx in adavance for anyting I can get.
CaNiX Those who seek me, must first seek the storm and the wolf who lerks within it.
 
Hi,
you have to set these properties, no matter how you open new window:

<body marginheight=&quot;0&quot; marginwidth=&quot;0&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot;>

You can also set them using javascript when you create new document in pop-up window. This is the right way of opening pop-up windows where you can set everything you want:

function newPopup() {

b = window.open(&quot;&quot;,&quot;newpage&quot;,&quot;status=no,toolbar=yes,width=400,height=100&quot;);
b.document.open();
b.document.write('<html><head><title>Some page</title></head>');
b.document.write('<body marginheight=&quot;0&quot; marginwidth=&quot;0&quot; leftmargin=&quot;0&quot; topmargin=&quot;0&quot;>');
b.document.write('<p>The content of this page</p>');
b.document.write('</body></html>');
b.document.close();
}

As you see, this script opens new window and creates new document (you don't even need to have an existing html page). All you need to do is to use document.write(' ... ') to create the page content. Just write an ordinary html code inside the quotes.

good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top