PC Review


Reply
Thread Tools Rate Thread

Centering Form On Page

 
 
Gerard Seibert
Guest
Posts: n/a
 
      4th Nov 2003
I am trying to create a single web page that has a background picture, some text and a subscription form. I have tried using the following to keep the form in the absolute center of the page.

<style type="text/css">
<!--
#form1 { position: absolute;
margin-left: expression((body.clientWidth-form1.offsetWidth)/2);
margin-top: expression((body.clientHeight+form1.offsetHeight)/2);
background-color: #ffffff}
body { background-image: url('blue_lady.gif')}
-->
</style>

I am using the following !doctype statement:

<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

I then use <div id=form1> "code for my form goes here" </div>

Everything seems all right until I add text to the page. Then the form will stay centered horizontally, but not vertically.

Can someone tell me what I am doing wrong, and how to correct it?

Thanks!

Gerard E. Seibert
gerard-(E-Mail Removed)

This...this isn't the Matrix? No. It's another training program designed to teach you one thing. If you are not one of us, you are one of them. - Neo and Morpheus, The Matrix


 
Reply With Quote
 
 
 
 
David Berry
Guest
Posts: n/a
 
      4th Nov 2003
A much easier way is to create a table with one cell, center it and put the
form inside it.

--
David Berry - MCP
Microsoft MVP - FrontPage
FrontPage Support: http://www.net-sites.com/sitebuilder/
-----------------------------------
To assist you in getting the best answers for FrontPage support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp
-----------------------------------
"Gerard Seibert" <gerard-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
I am trying to create a single web page that has a background picture, some
text and a subscription form. I have tried using the following to keep the
form in the absolute center of the page.

<style type="text/css">
<!--
#form1 { position: absolute;
margin-left:
expression((body.clientWidth-form1.offsetWidth)/2);
margin-top:
expression((body.clientHeight+form1.offsetHeight)/2);
background-color: #ffffff}
body { background-image: url('blue_lady.gif')}
-->
</style>

I am using the following !doctype statement:

<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

I then use <div id=form1> "code for my form goes here" </div>

Everything seems all right until I add text to the page. Then the form will
stay centered horizontally, but not vertically.

Can someone tell me what I am doing wrong, and how to correct it?

Thanks!

Gerard E. Seibert
gerard-(E-Mail Removed)

This...this isn't the Matrix? No. It's another training program designed to
teach you one thing. If you are not one of us, you are one of them. - Neo
and Morpheus, The Matrix



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
centering web page =?Utf-8?B?TWlsZXM=?= Microsoft Frontpage 3 26th Jun 2007 08:11 AM
Centering a Web Page Michael Microsoft Frontpage 10 29th Jan 2006 02:40 AM
Centering page JT Microsoft Frontpage 2 10th Oct 2005 03:13 PM
Centering the whole web page Stephen Microsoft Frontpage 15 29th Dec 2004 08:38 AM
Page Centering Tru Dixon Microsoft Frontpage 0 7th Jul 2003 05:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:13 PM.