Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 09-15-2011, 07:45 PM   #1
thiefwriter
Member
thiefwriter began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Sep 2011
Device: formatting for all
duplicate div id's

I should know this, but I'm so new at html and css. My eBook looks great in ePub and Mobi tests, but ePubCheck and ThreePress gave me lots of errors. Biggest seems to be duplicate div id's.

I guess that was my big mistake. I used one css div id for all images+caption, and another css div id for all sections I call "sidebar" so they have a certain look and rules at top and bottom.

There are many images and "sidebars" in each book chapter. How should I have handled the divs? I'm sure it's basic css…

I'll post the other error-type in a separate thread.

Thanks so much to anyone who can guide me…
thiefwriter is offline   Reply With Quote
Old 09-15-2011, 07:49 PM   #2
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,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Are you sure you didn't mean to put these in class and not ID? All you have to do if your class is correct is add say an incrementing number to each div.
JSWolf is offline   Reply With Quote
Advert
Old 09-15-2011, 08:10 PM   #3
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Yes, while css styling can be directed to apply to a specific id, it's really designed to be used with class selectors. Ids have to be unique within each particular file and are best used as targets for anchor references. I suspect you could solve your problem simply by changing all id="sidebar" to class="sidebar" (and change #sidebar in the css to .sidebar).
charleski is offline   Reply With Quote
Old 09-15-2011, 09:02 PM   #4
thiefwriter
Member
thiefwriter began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Sep 2011
Device: formatting for all
I'll try this before bothering you…

Ugh, just lost my complicated reply with code. But I think maybe charleski's advice will help. I'll work on that and report back. Thanks so much!
thiefwriter is offline   Reply With Quote
Old 09-15-2011, 09:14 PM   #5
thiefwriter
Member
thiefwriter began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Sep 2011
Device: formatting for all
Need to ask anyway:

Is it okay then to have multiple instances of "div class="sidebar" in one ebook chapter?

And shall I change the div.pic's to the same code, i.e. "div class="pic"?

A sample of my html:

Code:
<div id="sidebar">
			<p class="sidebarmark">Aside&hellip;</p>
			<p class="subhead">X-Ray Glasses</p>
blah, blah, blah…
</div>
Which should now become, if I understand correctly:

Code:
<div class="sidebar">
			<p class="sidebarmark">Aside&hellip;</p>
			<p class="subhead">X-Ray Glasses</p>
blah, blah, blah…
</div>
and

Code:
<div id="pic">

				<p class="center"><img src="b.luciano.jpg" alt="luciano" /><br />
						Luciano, a pickpocket who works on trams and buses.
					</p>
				</div>
…which should now become "div class="pic" ?

Just shows how badly a newby can screw it up. I needed to format an ebook, but I didn't know much about html and css. I'm learning, I hope…
thiefwriter is offline   Reply With Quote
Advert
Old 09-16-2011, 04:19 AM   #6
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
And you should change your CSS file from div#sidebar to div.sidebar (# is for ids, . is for classes)
Jellby is offline   Reply With Quote
Old 09-17-2011, 11:00 AM   #7
thiefwriter
Member
thiefwriter began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Sep 2011
Device: formatting for all
Thanks for the help everyone. That fixed me right up. I've got an error-free epub now!
thiefwriter is offline   Reply With Quote
Reply

Tags
css, div, epub errors

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a new column showing Id's curiosity Library Management 5 06-10-2011 03:54 AM
Center a div marcelo2605 ePub 4 05-13-2011 07:39 AM
ADE - Gerätebeschränkung bei Adobe ID's Esperanza Software 8 08-16-2010 04:16 AM
Two Adobe ID's, and I forgot which one I authorized my Reader with! curtw Sony Reader 2 07-08-2009 09:19 PM
Adding Books duplicates ID's Talung Calibre 4 02-10-2009 07:14 PM


All times are GMT -4. The time now is 01:09 AM.


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