![]() |
#1 |
Enthusiast
![]() Posts: 49
Karma: 10
Join Date: Mar 2016
Device: Ipad mini 2
|
Sigil div tag issue HELP
HI there I have just completed an ebook which is fine. . . until I put in about 6 url links on a few social media images at the back. sure its resolved simply though.
The error is on line 138 where the says: Error while parsing file: element "div" not allowed here; expected element (screen shot attached) also attached is screen for line 138 in sigil. what do I change. the same error is repeated so once I solve this I can correct the rest. what do I delete or replace?? thanks for you help . David |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,569
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
You can't nest div or p tags inside of a tags to my knowledge.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
You want your <div>s and <p>s on the outside + your <img>s and <a>s on the inside:
Code:
<div class="social"><img alt="" src="../Images/instagram.jpg"/></div> <p><a href="https://www.instagram.com/example">https://www.instagram.com/example</a></p> <div class="social"><img alt="" src="../Images/twitter.jpg"/></div> <p><a href="https://www.twitter.com/example">@example</a></p> |
![]() |
![]() |
![]() |
#4 |
Enthusiast
![]() Posts: 49
Karma: 10
Join Date: Mar 2016
Device: Ipad mini 2
|
thanks for that and I do understand what you are saying and I've tried it but obviously missing something my end.
can you let me know exactly how this should read and I can repair the others? this is how each one is laid out as follows: <a href="https://twitter.com/UnknownOrigins9"><div id="box5"><p class="figure"><img src="../Images/twit.jpg" width="560" height="67" alt="twit.jpg"/></p> </div></a> IS THIS BELOW CORRECT because I lose the URL and doesn't work: <div class="figure"><img src="../Images/twit.jpg" width="560" height="67" alt="twit.jpg"/></div> <p><a href="https://twitter.com/UnknownOrigins9"><div id="box5"</a></p> |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,569
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If you're trying to make the image an actual link, then that's fairly hit-or-miss when it comes to working properly across a range of devices/apps. That's probably why you "lose the URL and doesn't work". Especially if you're testing on something that uses Adobe's RMSDK for rendering.
Many devices provide some sort of pan and zoom functionality with images that wouldn't work if tapping on an image were to follow a link instead. You're better off using text for the link and adding the image separately. Quote:
Sigil doesn't appear to be related to the issue here. You seem to need to do a little brushing up on html in general. Last edited by DiapDealer; 05-17-2021 at 11:51 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
You can't do the part in red:
Code:
<a href="https://twitter.com/UnknownOrigins9"><div id="box5"><p class="figure"><img src="../Images/twit.jpg" width="560" height="67" alt="twit.jpg"/></p> </div></a> Code:
<div id="box5"> <p class="figure"><a href="https://twitter.com/UnknownOrigins9"><img src="../Images/twit.jpg" width="560" height="67" alt=""/></a></p> </div> Code:
<div class="box5"> <p class="figure"> <a href="LinkGoesHere"> <img src="../Images/twit.jpg" alt=""/> </a> </p> </div> What you're currently doing is opening and closing the <div>s + <p>s + <a>s all out of order! Side Note: In ebooks, it's also not a good idea to put the link around an image. It won't work on many ereaders. Better to have actual text to click on: Code:
[Blah blah blah, stick your image code here.] <p class="social"><a href="http://TwitterURLGoesHere">Visible Text Goes Here</a></p> Quote:
You see the broken <div>? Plus the <div> cannot go inside of a <p>. Last edited by Tex2002ans; 05-17-2021 at 12:00 PM. |
|
![]() |
![]() |
![]() |
#7 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,168
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
My preference where it is desired to attempt to make an image clickable is to insert the link twice. Once for the image and again using a text line below the image.
Code:
<div class="box5"> <p class="figure"><a href="https://www.google.ca"> <img src="../Images/twit.jpg" alt=""/> </a></p> <p class="center"><a href="https://www.google.ca">This is a clickable link</a></p> </div> |
![]() |
![]() |
![]() |
#8 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,745
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#9 | |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#10 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 46,168
Karma: 168983734
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
![]() |
![]() |
![]() |
#11 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Older versions of ADE won't make the linked image clickable at all. So if you include the link ONLY around the image, people won't be able to get to it. This is why you should always have human-readable URLs nearby, so readers can type the information in: Code:
<p>Find me in these places:</p> [Website's logo code] <--- Clickable image code optional. <p><a href="http://example.com">www.example.com</a></p> <p><a href="http://SocialMedia.com/example">SocialMedia.com/example</a></p> A user may click on it, trying to expand the image in order to pan/scan (or some other visual impairment reason). Instead, the browser will open or they'll unexpectedly jump to another location in the book. So never use the link around an important image within the book, like a map. For more information, see a few of the previous topics: 2019: "problems making an image a hyperlink in epub" 2014: "Link from an image to a YouTube video" Also, a few reasons why clickable images work a little better on the computer is because you have:
On ebooks, no such thing on most/(all?) devices. And also remember: If you ever create a physical print version of the book... there's no such thing as clickable images... so you'll likely have to place that human-readable fallback anyway! ![]() Last edited by Tex2002ans; 05-18-2021 at 06:42 PM. |
|
![]() |
![]() |
![]() |
#12 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
Interesting...
It seems like putting the link around the actual address is good, but putting it around the image could either do nothing, or potentially break the book/device functionality, and should be avoided. Thanks! |
![]() |
![]() |
![]() |
#13 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
We deal with this near-daily, with customers INSISTING that the bloody images "must be" clickable links. It doesn't matter if we explain that the tap initial action is zooming; that the user has no way to know it's a clickable link, OR that most Kindles in the eInk category don't have viable browsers. (Don't get me started about links to videos, ditto.) Hitch |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Understanding the div levels in Sigil | RSoldin | Sigil | 12 | 01-11-2019 03:29 AM |
Sigil issue or iBooks issue? | Tisha4870 | Sigil | 17 | 03-07-2014 07:29 PM |
heading tag with sigil 0.7.4 | bobcdy | Sigil | 3 | 01-12-2014 12:45 PM |
PDOC tag in Sigil? | Derek R | Sigil | 5 | 03-09-2013 12:39 PM |
sigil "condensation" of nested <div>'s | bobb40 | Sigil | 5 | 03-21-2012 07:42 PM |