02-11-2011, 04:24 PM | #1 |
Junior Member
Posts: 7
Karma: 10
Join Date: Feb 2011
Device: none
|
Problems with br
I’ve been finishing up a pretty long epub book, and somewhere along the line my <br />’s suddenly stopped working as expected. I tried Threepress’ validation service, and it turned up some errors. Most of them were easily fixed, but I keep getting:
ERROR: Pave Johanna.epub/content/kapittel2.html(57): element "br" from namespace "http://www.w3.org/1999/xhtml" not allowed in this context And A LOT of them. I don’t know if this has something to do with why they’re not working as expected, but from what I’ve read here and elsewhere the problem should be fixed with a strict doctype setting. Problem is, it doesn’t help. I’ve attached the .epub in question, and really hope someone can help me out. I suspect this is some stupid little error that causes a landslide of other errors. Last edited by frode frank; 02-11-2011 at 04:35 PM. Reason: Updated document |
02-11-2011, 05:29 PM | #2 |
Wizard
Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
|
In kapittel2.html, there are a bunch of br tags without a space before the closing slash. Maybe that's it?
|
Advert | |
|
02-11-2011, 05:38 PM | #3 |
Junior Member
Posts: 7
Karma: 10
Join Date: Feb 2011
Device: none
|
Thank you. I fixed that, but it doesn’t help with my problem.
|
02-11-2011, 06:00 PM | #4 |
Wizard
Posts: 1,213
Karma: 12890
Join Date: Feb 2009
Location: Amherst, Massachusetts, USA
Device: Sony PRS-505
|
I think in some species of XHTML, <br /> tags must always be inside other parent elements, so if <br /> is just sitting by itself, consider changing it to <p><br /></p> -- though I think you must also consider whether you really shouldn't instead simply add to the margins either below the previous paragraph or above the next paragraph in such cases (e..g, margin-bottom: 2ex; for the CSS for the paragraph above).
|
02-11-2011, 07:04 PM | #5 |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
frabjous nailed it - the <br/> tags are all sitting uncontained, rather than being inside a block level element such as P or DIV or a heading (H1, H2, etc). At the moment, the structure is kind of like this:
Code:
<p> ...stuff inside the P element... </p> <br/> <p> ...stuff inside next P element... </p> Last edited by DMSmillie; 02-11-2011 at 07:15 PM. |
Advert | |
|
02-11-2011, 07:13 PM | #6 | |
Enquiring Mind
Posts: 562
Karma: 42350
Join Date: Aug 2010
Location: London, UK
Device: Kindle 3 (WiFi)
|
Quote:
Just thought I'd mention it, since I see the issue of that space before the closing slash come up every now and then in the forums. |
|
02-11-2011, 07:21 PM | #7 |
Junior Member
Posts: 7
Karma: 10
Join Date: Feb 2011
Device: none
|
Yeay! Working and valid. Thanks!
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Firmware Update 3.01 - Anyone else have problems? | JeremyR | Amazon Kindle | 9 | 09-15-2010 10:39 PM |
I've got a few problems | RubenRybnik | Sony Reader | 13 | 03-10-2010 10:06 PM |
a few problems | kceb10 | Sony Reader | 8 | 03-09-2010 07:09 AM |
A few problems | mand | iRex | 4 | 03-08-2009 10:42 AM |