View Full Version : Question about image

12-03-2012, 07:48 PM

I am trying to have my image center and adjust the size automatically when the viewers enlarge the tablets.

<title>The Creativity Revolution</title>
<link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />
<link href="../Styles/page_styles.css" rel="stylesheet" type="text/css" />

<style type="text/css">

p.sgc-2 {text-align: center;}
div.sgc-1 {text-align: center;}

<body class="calibre">
<div class="sgc-1"><img alt="" src="../Images/Alabamafinal72.jpg" /></div>

<path gradientshapeok="t"></path>


can anyone please help out here?

12-04-2012, 12:18 AM
This message moved to ePub as it has nothing to do with Sigil.

me too
12-04-2012, 05:37 AM
i dont know whether you have solved the question or not any ways i have tried your code and it is working fine!

12-04-2012, 05:55 AM
If your targeting an iPad or ADE device then better use an SVG code for the image.

12-06-2012, 11:16 AM
to get images to center on iOS you should make them inline-blocks and wrap them in a div:


.my_div { width:100%; text-align:center; }
.my_img { width:80%; display:inline-block; }


<div class="my_div">
<img alt="My Image" class="my_img" src="path/img.jpg" />

this will center the image, which will be sized to 80% of the width of the frame.

12-07-2012, 05:36 AM
You don't need inline-block (unless the reader is buggy), which is unsupported in ePub 2.1 anyway.