12-03-2012, 06:48 PM | #1 |
Junior Member
Posts: 1
Karma: 10
Join Date: Oct 2012
Device: none
|
Question about image
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? |
12-03-2012, 11:18 PM | #2 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
This message moved to ePub as it has nothing to do with Sigil.
|
12-04-2012, 04:37 AM | #3 |
Connoisseur
Posts: 57
Karma: 1350
Join Date: Jul 2012
Location: India
Device: none
|
hello
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, 04:55 AM | #4 |
Connoisseur
Posts: 51
Karma: 29994
Join Date: Nov 2011
Location: Manila, Philippines
Device: iPad 2 & Nexus 7
|
If your targeting an iPad or ADE device then better use an SVG code for the image.
|
12-06-2012, 10:16 AM | #5 |
Groupie
Posts: 171
Karma: 86271
Join Date: Feb 2012
Device: iPad, Kindle Touch, Sony PRS-T1
|
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. |
12-07-2012, 04:36 AM | #6 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
You don't need inline-block (unless the reader is buggy), which is unsupported in ePub 2.1 anyway.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cover image isn't displaying as cover image | Eugene88 | Sigil | 3 | 08-15-2012 04:05 PM |
Image overlayed over text (but text visible if image disabled)? | Kaylee Skylyn | ePub | 5 | 08-01-2012 05:27 PM |
Sigil Cover image Question | ralphiedee | Sigil | 9 | 05-30-2012 10:54 AM |
Image captions --- how to keep with image? | GrannyGrump | ePub | 7 | 01-31-2012 12:38 PM |
"Insert Image" renames .jpg's incorrectly... but shows the correct image! | megacoupe | Sigil | 4 | 03-06-2011 08:13 PM |