Common Attributes: Sizing

The size of an object may be set using the sizing attributes width and height.

Attributes

Name Description
width Specifies the width of the object.
height Specifies the height of the object.

Example

In this example, the size of the image is set to 200 px. by 50 px.

<?xml version="1.0"?>
<viewer xmlns="http://issuu.com/viewer/1.0" backgroundColor="#111111">
 
 <skin source="skins.swf"/>
 
 <image source="#Logo" left="10" top="20" width="200" height="50"/>
 
 ...
 
</viewer>

The size of an object may also be determined by the constraints placed upon it by the positioning attributes.

In this example, the image is positioned 10 px. from the left edge, and 10 px. from the right edge of the Viewer; thus constraining it's width to a total of 20 px. less than the width of the Viewer.

<?xml version="1.0"?>
<viewer xmlns="http://issuu.com/viewer/1.0" backgroundColor="#111111">
 
 <skin source="skins.swf"/>
 
 <image source="#Reflection" left="10" right="10"/>
 
 ...
 
</viewer>

If either the width or the height of an object is left unspecified, it may be calculated automatically based on the object’s contents or based on its intrinsic size.

 

Contents