WD2000: HTML: Arbitrary Attributes (WIDTH and HEIGHT) Ignored/Lost in Word

ID: Q220446


The information in this article applies to:


SYMPTOMS

After you use the WIDTH and HEIGHT attributes in your HTML code, your Web page may appear correctly in a Web browser. However, when you open the Web page in Microsoft Word, the WIDTH and HEIGHT attributes are ignored and do not appear as you intended.

Also, after you save the Web page in Word and redisplay the page in your Web browser, your Web page may appear the same as it did in Word. In other words, the width and height of your image are not retained as you intended.

For example, your Web page containing the following HTML code:


<html>
<head>
</head>
<body>
<P style='width:70pt; height:70pt;background:#FF0000'>Microsoft</P>
</body>
</html> 
appears as the following in a Web browser:

Microsoft

When you open the Web page in Word 2000, the page appears as in the following example:

Microsoft

NOTE: After you save the Web page in Word and reopen the Web page in your Web browser, the page appears the same as it did in Word.


CAUSE

This functionality is by design, because Word does not support or retain arbitrary attributes such as WIDTH and HEIGHT to override the default behavior of HTML elements (user agents or tags).


MORE INFORMATION

The WIDTH and HEIGHT attributes can be used in a Web page to override the default behavior (interpretation) of user agents in favor of the specified values. When these attributes are used in this manner, the attributes are referred to as arbitrary.

When the object is an image, it is scaled. User agents are designed to scale an object or image as nearly as possible to match the width and height specified by the author. Note that lengths expressed as percentages are based on the horizontal or vertical space currently available, not on the natural size of the image, object, or applet.

The WIDTH and HEIGHT attributes give user agents information about the size of an image or object so that the user agents may reserve space for the object or image and continue rendering the document while waiting for the image data.


REFERENCES

For more detailed information about HyperText Markup Language (HTML), please refer to one of the following Web addresses:

World Wide Web Consortium (W3C)
http://www.w3.org/
MSDN Online
http://msdn.microsoft.com

Additional query words: incorrect position positioning


Keywords          : kbdta wd2000 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: July 15, 1999