View Full Version : Question about image


yakimeshi
12-03-2012, 07:48 PM
Hi,

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

===============================
<head>
<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;}
</style>
</head>

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

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

</body>
</html>
=================================

can anyone please help out here?

DaleDe
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
hello
i dont know whether you have solved the question or not any ways i have tried your code and it is working fine!

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

mzmm
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:

css:

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

html:

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

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

Jellby
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.