Home  Beta programs 
  Welcome to Mobipocket Developer Center
Home | Show TOC | Add to Favorites

Margins

The top, left, right margins are specified for the whole eBook file. These settings override the default user settings for margins and which can be changed by the user in the Settings pane of the Reader.
Use the topmargin, leftmargin, rightmargin, bottommargin attributes in the BODY tag of the first HTML file referenced in the spine of the OPF publication file.

<body topmargin="1em" leftmargin="2em" bottommargin="0" rightmargin="0">

<body topmargin="3px" leftmargin="10px">

px and em are supported as valid units.

Note : 

  • You cannot set different margins for different parts of the eBook
  • Only the margin attribute of the BODY tag of the first HTML file in the spine is used, all other margin information in other HTML files is ignored

When using slave frames, if the frame content is in an external HTML file, you can use the same attribute in the BODY tag of the slave frame file.
If the slave frame content is embedded inside the <mbp:slave-frame> tag, use the topmargin, leftmargin, rightmargin, bottommargin attributes directly in the <mbp:slave-frame> tag.

Example : 

<mbp:slave-frame device="pda" display="top" breadth="30px" topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0">Some slave content
</mbp:slave-frame> 

 

Copyright 2000-2007 Mobipocket.com