PC Review


Reply
Thread Tools Rate Thread

!DOCTYPE screws up page layout

 
 
Gerard Seibert
Guest
Posts: n/a
 
      9th Nov 2003
I am having a problem that I can just not figure out. If I run the following, it will produce a jumble of text at the top of the screen. However, if I remove the !DOCTYPE declaration, it will work perfectly.

This is the HTML code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test of Positioning</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="copyright" content="Copyright © 2003, Bud Man">
<meta name="description" content="Your DESCRIPTION TEXT here">
<meta name="keywords" content="Your KEYWORDS TEXT here">
<meta name="rating" content="General">
<meta name="robots" content="Index, follow">
<style type="text/css">
P {behavior:url(pos.htc);
border:1px black solid;
font:10pt geneva, arial;
padding:2pt}
</style>
</head>
<body>
<p vpos="top" hpos="left"><nobr>Top-Left</nobr></p>
<p vpos="top" hpos="center"><nobr>Top-Center</nobr></p>
<p vpos="top" hpos="right"><nobr>Top-Right</nobr></p>
<p vpos="middle" hpos="left"><nobr>Middle-Left</nobr></p>
<p vpos="middle" hpos="center"><nobr>Middle-Center</nobr></p>
<p vpos="middle" hpos="right"><nobr>Middle-Right</nobr></p>
<p vpos="bottom" hpos="left"><nobr>Bottom-Left</nobr></p>
<p vpos="bottom" hpos="center"><nobr>Bottom-Center</nobr></p>
<p vpos="bottom" hpos="right"><nobr>Bottom-Right</nobr></p>
</body>
</html>

This is the code for pos.htc:

<PUBLIC:COMPONENT NAME="ID_POSITION">
<PUBLIC:PROPERTY NAME="vpos">
<PUBLIC:PROPERTY NAME="hpos">
<SCRIPT>
// Copyright 1999 InsideDHTML.com, LLC. All rights reserved.
// For more information, see www.insideDHTML.com
// This behavior can be reproduced as long as this copyright
// notice is not removed.

var hExpr = "",vExpr = ""

switch (vpos) {
case "top":
vExpr="document.body.scrollTop+offsetHeight-offsetHeight"
break;
case "middle":
vExpr="document.body.scrollTop+((document.body.clientHeight-offsetHeight)/2)"
break;
default:
vExpr="document.body.scrollTop+document.body.clientHeight-offsetHeight"
}

switch (hpos) {
case "left":
hExpr="document.body.scrollLeft+offsetLeft-offsetLeft"
break;
case "center":
hExpr="document.body.scrollLeft+((document.body.clientWidth-offsetWidth)/2)"
break;
default:
hExpr="document.body.scrollLeft+document.body.clientWidth-offsetWidth"
}

style.position = "absolute"
style.setExpression("top",vExpr)
style.setExpression("left",hExpr)
</SCRIPT>
</PUBLIC:COMPONENT>

I would appreciate any help that someone could give me.

Thanks!

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

I am just an old country boy in a big town trying to get along. I have been eating pretty regular and the reason I have been is because I have stayed an old country boy.

- Will Rogers


 
Reply With Quote
 
 
 
 
Jimmy
Guest
Posts: n/a
 
      10th Nov 2003
On Sun, 9 Nov 2003 11:01:16 -0500, "Gerard Seibert"
<gerard-(E-Mail Removed)> wrote:

>I am having a problem that I can just not figure out. If I run the following, it will produce a jumble of text at the top of the screen. However, if I remove the !DOCTYPE declaration, it will work perfectly.
>
>This is the HTML code:
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
>"http://www.w3.org/TR/html4/strict.dtd">



A quick check in a validator tells me that your code does not meet the
DOCTYPE requirements you included. It also appears to be MS
proprietary. There are errors in your script code.




 
Reply With Quote
 
Cheryl D. Wise
Guest
Posts: n/a
 
      10th Nov 2003
<nobr> is not valid code under a strict doctype definition. Generally with
FrontPage it is better to use a transitional or loose doctype.

In addition the validator has no way of knowing what "vpos" or "hpos" is so
it will never validate in any W3C validator.

--
Cheryl D. Wise
MS-MVP-FrontPage
http://wiserways.com

"Gerard Seibert" <gerard-(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
I am having a problem that I can just not figure out. If I run the
following, it will produce a jumble of text at the top of the screen.
However, if I remove the !DOCTYPE declaration, it will work perfectly.

This is the HTML code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Test of Positioning</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="copyright" content="Copyright © 2003, Bud Man">
<meta name="description" content="Your DESCRIPTION TEXT here">
<meta name="keywords" content="Your KEYWORDS TEXT here">
<meta name="rating" content="General">
<meta name="robots" content="Index, follow">
<style type="text/css">
P {behavior:url(pos.htc);
border:1px black solid;
font:10pt geneva, arial;
padding:2pt}
</style>
</head>
<body>
<p vpos="top" hpos="left"><nobr>Top-Left</nobr></p>
<p vpos="top" hpos="center"><nobr>Top-Center</nobr></p>
<p vpos="top" hpos="right"><nobr>Top-Right</nobr></p>
<p vpos="middle" hpos="left"><nobr>Middle-Left</nobr></p>
<p vpos="middle" hpos="center"><nobr>Middle-Center</nobr></p>
<p vpos="middle" hpos="right"><nobr>Middle-Right</nobr></p>
<p vpos="bottom" hpos="left"><nobr>Bottom-Left</nobr></p>
<p vpos="bottom" hpos="center"><nobr>Bottom-Center</nobr></p>
<p vpos="bottom" hpos="right"><nobr>Bottom-Right</nobr></p>
</body>
</html>

This is the code for pos.htc:

<PUBLIC:COMPONENT NAME="ID_POSITION">
<PUBLIC:PROPERTY NAME="vpos">
<PUBLIC:PROPERTY NAME="hpos">
<SCRIPT>
// Copyright 1999 InsideDHTML.com, LLC. All rights reserved.
// For more information, see www.insideDHTML.com
// This behavior can be reproduced as long as this copyright
// notice is not removed.

var hExpr = "",vExpr = ""

switch (vpos) {
case "top":
vExpr="document.body.scrollTop+offsetHeight-offsetHeight"
break;
case "middle":

vExpr="document.body.scrollTop+((document.body.clientHeight-offsetHeight)/2)
"
break;
default:
vExpr="document.body.scrollTop+document.body.clientHeight-offsetHeight"
}

switch (hpos) {
case "left":
hExpr="document.body.scrollLeft+offsetLeft-offsetLeft"
break;
case "center":

hExpr="document.body.scrollLeft+((document.body.clientWidth-offsetWidth)/2)"
break;
default:
hExpr="document.body.scrollLeft+document.body.clientWidth-offsetWidth"
}

style.position = "absolute"
style.setExpression("top",vExpr)
style.setExpression("left",hExpr)
</SCRIPT>
</PUBLIC:COMPONENT>

I would appreciate any help that someone could give me.

Thanks!

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

I am just an old country boy in a big town trying to get along. I have been
eating pretty regular and the reason I have been is because I have stayed an
old country boy.

- Will Rogers



 
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
Does DocType code go on every page? =?Utf-8?B?TWlrZSBD?= Microsoft Frontpage 1 28th Mar 2007 04:25 AM
RE: Does DocType code go on every page? =?Utf-8?B?Q29yZXkgQnJ5YW50?= Microsoft Frontpage 0 28th Mar 2007 02:17 AM
When I insert a doctype my home page loses its mind =?Utf-8?B?VHJldm9yRg==?= Microsoft Frontpage 1 26th Jul 2006 05:01 PM
front page screws up my URL's =?Utf-8?B?RGF2ZSBMZXZpbmU=?= Microsoft Frontpage 1 12th Jul 2005 05:01 PM
DOCTYPE causing unwanted page rendering Kulvinder Singh Matharu Microsoft Frontpage 6 19th Apr 2004 06:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:55 PM.