Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-21-2020, 02:32 AM   #16
AlwaysNew
Member
AlwaysNew began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2020
Device: Kindle
It turns out the keyboard had curly quotes turned on (not my computer) - hard to see as they're just slightly slanted to the right in HTML. Now that's off and corrected to straight quotes, my original code works! But using a 300ppi image is a great recommendation for hi-res devices. Thanks all for helping.
AlwaysNew is offline   Reply With Quote
Old 07-21-2020, 09:20 AM   #17
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,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Glad you found the curly quotes but be very careful with your - it just works - statement.

Your code does NOT work....at the least, there are a few important errors you should fix.
  • You don't need the </img>...the tag is self closing
  • Setting both height and width may cause your image to lose it's aspect ratio - only set one (normally width) and the other will auto adjust to the correct ratio
  • You are setting the width multiple times...you only need one...multiple entries can slow down the renderer because it has to figure out which one to apply
  • Why are you using a span at all - just to put the graphic on a new line?? How about just putting it in its own block level tag?
  • (This is mostly just annoying not an error) You don't need a unit after a 0 (zero) dimension...zero of anything is zero...in any case, be consistent.
  • Also, FYI, using a % for a padding/margin can cause layout inconsistencies that most try to avoid. Think about the difference between a 4" and a 10" screen. To keep layout internally consistent normally one would tie spacing to the font size.
  • Also-Also, in this case having both margin and padding can be confusing to you and make the render take longer - they are effectively doing the same thing in this instance, making the spacing a whopping 4%. Just choose one of them to set the distance where you want it.
Quote:
Originally Posted by AlwaysNew View Post
Code:
<span class=“s3”>
<img src="images/ne-logo100.png" alt="ne-logo100.png" class=“s2”/></span></img>
CSS:
Code:
.s2 { /* NE LOGO */
  height: 50%;
  width: 50%
}
.s3 { /* NE LOGO */
  display: inline-block;
  vertical-align: baseline;
  width: 1.336em;
  margin-left: 0%;
  margin-top: 2%;
  padding-top: 2%;
  margin-right: 0;
  margin-bottom: 0%;
  text-indent: 0;
  max-width: 50%;
  width: 100.000%;
}
I totally understand that you might not be uber-familiar with CSS/HTML, just realize that some of those software packages that do a great job laying out a for-print-document can really "get intimate with a canine" when it comes to electronic, reflowable, documents.

Here is a good recommendation that does what you say you want in a much simpler manner. Try it and see...

Code:
div.image {margin: 4em auto 0; width: .5in}

<div class="image"><img alt="" src="images/ne-logo100.png"/></div>
Turtle91 is offline   Reply With Quote
Old 07-21-2020, 02:16 PM   #18
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: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Do not use 2% for your margin top. That changes between different Readers. A Kindle PW4, Kobo Libra H2O, Kobo Aura H2O, Kobo Forma, and Kindle Basic, Pocketbook Inkpad X, and Pockebook Inkpad 3 Pro will all display the space differently because they all have different size screens. So 2% will be different.

Use a space like margin-top: 1em; as that will be much more consistent. % is usually not good to use.
JSWolf is offline   Reply With Quote
Old 07-21-2020, 05:02 PM   #19
AlwaysNew
Member
AlwaysNew began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Jun 2020
Device: Kindle
Thanks @Turtle91 @JSWolf for your helpful info. After much hair pulling I've given up. Deleted the bloody thing and have done with it. Unless I pay a professional, it's just not worth my time. Infuriating. I'm not really cut out for this. I'm a writer not a coder. Thanks anyway.
AlwaysNew is offline   Reply With Quote
Old 07-21-2020, 09:35 PM   #20
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: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by AlwaysNew View Post
Thanks @Turtle91 @JSWolf for your helpful info. After much hair pulling I've given up. Deleted the bloody thing and have done with it. Unless I pay a professional, it's just not worth my time. Infuriating. I'm not really cut out for this. I'm a writer not a coder. Thanks anyway.
To be honest, learning CSS/HTML is not that difficult. I leaned a lot by diving into the code of a lot of ePub head first.
JSWolf is offline   Reply With Quote
Reply

Tags
css, image, resize


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
paste cover image changes image's size pipistrelosone Editor 1 10-07-2016 09:10 AM
Image size JSWolf Feedback 19 11-13-2015 05:16 AM
Image size. UncleIvor ePub 13 04-04-2015 04:15 AM
Display of a png image linked to a svg image roger64 Editor 6 03-13-2015 06:21 AM
Image Size benjaminsolah ePub 13 09-24-2010 11:47 PM


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


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