Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-30-2022, 12:19 AM   #1
cleocalliope
Junior Member
cleocalliope began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2015
Device: none
Wrapping Text Around Images

The title more or less says it all. I've been trying to get text to wrap around the images. It works in the Sigil preview, but when I try to open the file in an epub reader, it doesn't work. What happens instead is that the image is inline with the first line of the text. The rest of the text is below the image. Help?


CSS:
div.img {
display: block;
}

img.left {
float: left;
display: block;
margin: 0 .7em .4em .3em;
}


XHTML:
<div class="img">
<img class="left" align="left" alt="Chemestry" src="../Images/hopesprings01.png"/>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean semper pulvinar odio, quis egestas sapien vestibulum quis. Vivamus pretium quis nisl vulputate pulvinar. Morbi et sodales neque, a consectetur sem. Aenean et tristique sapien. Cras a orci imperdiet, tincidunt mauris et, semper augue. Praesent gravida sem ut magna luctus fringilla. Duis quis lorem a nisl semper eleifend. Vestibulum eget nunc urna.<br /><br />

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean semper pulvinar odio, quis egestas sapien vestibulum quis. Vivamus pretium quis nisl vulputate pulvinar. Morbi et sodales neque, a consectetur sem. Aenean et tristique sapien. Cras a orci imperdiet, tincidunt mauris et, semper augue. Praesent gravida sem ut magna luctus fringilla. Duis quis lorem a nisl semper eleifend. Vestibulum eget nunc urna.
</div>

Last edited by cleocalliope; 04-30-2022 at 12:22 AM.
cleocalliope is offline   Reply With Quote
Old 04-30-2022, 01:18 AM   #2
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 315
Karma: 3196766
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Divs are already block level elements. Your div.img isn’t doing anything a regular <div> wouldn’t. I’d try wrapping your text in <p>s, and scrapping those <br/>s. That’s likely the actual reason for your problem. Your image isn’t floating around another element, because there isn’t another element. It’s just naked text in the div.

As a side note, both rules are probably overspecific. Your files will be more manageable if you use eg. .left instead of img.left unless you are using different styles for left-floated images vs any other left-floated elements.

Last edited by phillipgessert; 04-30-2022 at 01:38 AM.
phillipgessert is offline   Reply With Quote
Advert
Old 04-30-2022, 07:34 AM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Yup...what he said.

Try:

Code:
CSS:
div.imgleft {
float: left;
margin: 0 .7em .4em .3em;
}


XHTML:
<div class="imgleft"><img alt="Chemestry" src="../Images/hopesprings01.png"/></div>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean semper pulvinar odio, quis egestas sapien vestibulum quis. Vivamus pretium quis nisl vulputate pulvinar. Morbi et sodales neque, a consectetur sem. Aenean et tristique sapien. Cras a orci imperdiet, tincidunt mauris et, semper augue. Praesent gravida sem ut magna luctus fringilla. Duis quis lorem a nisl semper eleifend. Vestibulum eget nunc urna.</p>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean semper pulvinar odio, quis egestas sapien vestibulum quis. Vivamus pretium quis nisl vulputate pulvinar. Morbi et sodales neque, a consectetur sem. Aenean et tristique sapien. Cras a orci imperdiet, tincidunt mauris et, semper augue. Praesent gravida sem ut magna luctus fringilla. Duis quis lorem a nisl semper eleifend. Vestibulum eget nunc urna.</p>
Turtle91 is offline   Reply With Quote
Old 04-30-2022, 10:10 PM   #4
cleocalliope
Junior Member
cleocalliope began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2015
Device: none
[QUOTE=phillipgessert;4217562our files will be more manageable if you use eg. .left instead of img.left unless you are using different styles for left-floated images vs any other left-floated elements.[/QUOTE]

I have no idea what you're talking about. What's eg? I don't remember a CSS code called eg.

I had the paragraphs done with <p> but tried using the <br /> on the advice of a CSS website.
cleocalliope is offline   Reply With Quote
Old 04-30-2022, 10:13 PM   #5
cleocalliope
Junior Member
cleocalliope began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2015
Device: none
I just tried the code, but it didn't work. The image is no longer inline with the first sentence of the paragraph. It's just centered above it. I'm just not sure how that CSS centered the image.

Last edited by cleocalliope; 04-30-2022 at 10:15 PM.
cleocalliope is offline   Reply With Quote
Advert
Old 04-30-2022, 11:05 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
eg stands for the Latin phrase exempli gratia, meaning “for example.”

Based on the little bit of code you gave here, the code provided above will work. however if you have other styling saying differently, then it may take precedence...e.g.

p {clear:both}

we won't know unless we can see more of your CSS sheet and the area around what you are trying to affect.

The only other thing I can think of is your reader doesn't follow the styling that is included with the ePub...it uses it's own built-in styling. What reader are you testing on, and does it have a "use publisher styling" option, or somesuch?
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2022-04-30 230830.png
Views:	144
Size:	583.6 KB
ID:	193557  

Last edited by Turtle91; 04-30-2022 at 11:10 PM.
Turtle91 is offline   Reply With Quote
Old 04-30-2022, 11:44 PM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,724
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
@Turtle91, do you have CSS code for irregular shaped images and not rectangular or square?
JSWolf is offline   Reply With Quote
Old 05-01-2022, 01:20 AM   #8
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,126
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
do you have CSS code for irregular shaped images and not rectangular or square?
Please! Not that can of worms again. I remember several discussions as far back as 2013 and none of them worked across multiple platforms reliably. AFAIR, the discussion I am remembering from 2014 was related to an L shaped image and even there cross-platform was a PITA. I even seem to remember one JSWolf participating in those discussions. One of the best solutions was (if I am remembering correctly) was on Liz Castro's Pigs, Gourds and Wikis and even that was only reliable on the then version of iBooks.
DNSB is offline   Reply With Quote
Old 05-01-2022, 01:28 AM   #9
phillipgessert
Addict
phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.phillipgessert ought to be getting tired of karma fortunes by now.
 
phillipgessert's Avatar
 
Posts: 315
Karma: 3196766
Join Date: Oct 2015
Location: Madison, WI
Device: Kindle 5th Gen
Quote:
Originally Posted by cleocalliope View Post
I have no idea what you're talking about. What's eg? I don't remember a CSS code called eg.

I had the paragraphs done with <p> but tried using the <br /> on the advice of a CSS website.
Sorry. I can see how that was confusing. Please ignore my entire side note. I would recommend taking some time to learn a little more about HTML and CSS. Jon Duckett wrote a very accessible and understandable book about their relationship. And I would also recommend avoiding most online advice about using <br/>. It is a very useful tag but is often abused. It seems unsuitable here.

Last edited by phillipgessert; 05-01-2022 at 01:32 AM.
phillipgessert is offline   Reply With Quote
Old 05-01-2022, 10:11 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,046
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
@Turtle91, do you have CSS code for irregular shaped images and not rectangular or square?
Almost a decade ago, someone posted a series of examples here at MR:
parrot.epub
They slice the image when the shape changes
theducks is online now   Reply With Quote
Old 05-01-2022, 03:59 PM   #11
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,126
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Perhaps take a look at the epub code snippets (html / css) thread.
DNSB is offline   Reply With Quote
Old 05-02-2022, 05:13 AM   #12
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by JSWolf View Post
@Turtle91, do you have CSS code for irregular shaped images and not rectangular or square?
I seem to remember the same discussion from awhile ago. But, no, I haven’t found the need, yet, for irregularly shaped images.
Turtle91 is offline   Reply With Quote
Old 05-07-2022, 12:06 PM   #13
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
>eg stands for the Latin phrase exempli gratia, meaning “for example.”

It was a tragedy when Latin ceased to be a part of the college-prep curriculum. Not that the STUDENTS lost the language, but that future teachers did.
Notjohn is offline   Reply With Quote
Old 05-07-2022, 12:08 PM   #14
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,347
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Amen!

I hear these complaints all the time from my HS Latin teacher wife!!
Turtle91 is offline   Reply With Quote
Old 05-08-2022, 04:17 PM   #15
cleocalliope
Junior Member
cleocalliope began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Aug 2015
Device: none
Quote:
Originally Posted by Turtle91 View Post
we won't know unless we can see more of your CSS sheet and the area around what you are trying to affect.
Sorry about the delay in getting back to you. RL.

Here's my full CSS:
Spoiler:


.storybody {
margin-top: 0;
display: block;
font-size: .9em;
padding-left: 0;
padding-right: 0;
margin-bottom: 0;
margin-left: 10pt;
margin-right: 10pt;
text-align: justify;
font-family: Georgia, serif;
}

p {
margin-left: 0;
display: block;
margin-right: 0;
margin-bottom: .8em;
text-align: justify;
font-family: Georgia, serif;
}

a {
color: #a60000;
text-decoration: none;
}

p.title {
margin: auto;
font-size: 1.8em;
margin-bottom: 8px;
text-align: center;
letter-spacing: 1.5px;
font-variant: small-caps;
font-family: Georgia, serif;
}

p.subtitle {
margin: auto;
font-size: 1.1em;
margin-bottom: 8px;
text-align: center;
letter-spacing: 1.5px;
font-family: Georgia, serif;
}

p.dtitle1 {
margin: auto;
font-size: 1.6em;
text-align: center;
letter-spacing: 1.5px;
font-variant: small-caps;
font-family: Georgia, serif;
}

p.dtitle2 {
margin: auto;
font-size: 1.3em;
width: 70%;
margin-bottom: 25px;
text-align: center;
letter-spacing: 1.5px;
font-variant: small-caps;
font-family: Georgia, serif;
}

p.indent {
display: block;
margin-right: 0;
margin-left: 2em;
margin-bottom: .8em;
text-align: justify;
font-family: Georgia, serif;
}

p.section {
font-size: 1.2em;
margin-bottom: 8px;
text-align: center;
letter-spacing: 1.3px;
font-variant: small-caps;
text-decoration: underline;
font-family: Georgia, serif;
}


p.italics {
display: block;
font-style: italic;
font-family: Georgia, serif;
}

a {
color: black;
}


img.center {
display: block;
margin-top: 1em;
margin-bottom 1em;
text-align: center;
margin-left: auto;
margin-right: auto;
}


div.imgleft {
float: left;
margin: 0 .7em .4em .3em;
}


div.imgright {
float: right;
margin: 0 0.7em 0 0.7em;
}

.imgborder {
padding: 1px;
border: 2.3px solid black;
}

.spacebottom {
margin-bottom: 2em;
}

.spacetop {
margin-top: 2em;
}


Last edited by theducks; 05-08-2022 at 04:30 PM. Reason: spoilered
cleocalliope is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text wrapping around pictures: yes on epub, no on mobi? kevin_y Conversion 13 10-13-2020 04:22 PM
wrapping text in the main interface? tracis035 Library Management 1 11-01-2016 11:33 PM
Wrapping text around images lof Conversion 10 11-22-2012 05:09 AM
How to fix text wrapping from a pdf? pitchforks Workshop 2 04-29-2012 05:53 AM
Images and text wrapping steveboyett Calibre 3 07-20-2010 08:26 PM


All times are GMT -4. The time now is 10:13 PM.


MobileRead.com is a privately owned, operated and funded community.