Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-03-2013, 12:30 PM   #91
abeonis
eBook DIYer
abeonis began at the beginning.
 
abeonis's Avatar
 
Posts: 111
Karma: 10
Join Date: Oct 2012
Location: Europe
Device: K4, KF HD 8.9, Readium
Quote:
Originally Posted by SBT View Post
Personally, I prefer to create an id for every image, and specify the size in the style sheet. Then nobody can accuse me of not separating content and display attributes Somehow it also seems tidier to lump all image attributes together in one corner of the stylesheet.
I am curious to know who can accuse you to "not separate content and display attributes" and how they control what you do. Damned, Big Brother is an ePub reader.

My flow doesn´t work this way. I use always the same css (various) for all my eBooks. I have defined one presentation model with specifc styles I always use. If I discover a need for another class, I include it in my master css. This didn't happen for a while now.

But I am sure your way of doing things works fine for you. Chacun fait ce qui lui plaît.
abeonis is offline   Reply With Quote
Old 06-03-2013, 02:29 PM   #92
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
Quote:
Originally Posted by abeonis View Post
I am curious to know who can accuse you to "not separate content and display attributes" and how they control what you do. Damned, Big Brother is an ePub reader.
Well, I don't want to end up as the bad guy in the next episode of "CSS Miami"

So do you only use class selectors in your stylesheet, and no id selectors?
SBT is offline   Reply With Quote
Advert
Old 06-03-2013, 02:32 PM   #93
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: 74,015
Karma: 129333114
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 SBT View Post
Well, I don't want to end up as the bad guy in the next episode of "CSS Miami"

So do you only use class selectors in your stylesheet, and no id selectors?
Not possible to be a bad guy in the next episode of CSI Miami as the show's been cancelled.

As for the stylesheet, you use classes and not ids.
JSWolf is offline   Reply With Quote
Old 06-03-2013, 02:44 PM   #94
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by JSWolf View Post
Not possible to be a bad guy in the next episode of CSI Miami as the show's been cancelled.

As for the stylesheet, you use classes and not ids.
Actually, you can use both.
Doitsu is offline   Reply With Quote
Old 06-03-2013, 02:47 PM   #95
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
From the w3cschools site:
Quote:
The id selector is used to specify a style for a single, unique element.
...
The class selector is used to specify a style for a group of elements. Unlike the id selector, the class selector is most often used on several elements.
SBT is offline   Reply With Quote
Advert
Old 06-03-2013, 03:04 PM   #96
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
This is the ePub forum. It won't work in ADE. So what I said is correct for ePub. In fact, if you try it with ADE, ADE will take it as an error and none of the CSS will be applied.

Last edited by JSWolf; 06-03-2013 at 03:13 PM.
JSWolf is offline   Reply With Quote
Old 06-03-2013, 03:13 PM   #97
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
Quote:
Originally Posted by JSWolf View Post
This is the ePub forum. It won't work in ADE. So what I said is correct for ePub.
Incorrect on two counts. Firstly, ADE is not fully epub-compliant, so that if it does not work in ADE does not necessarily imply invalid epub.
Secondly, it does work in ADE, and is according to spec.
SBT is offline   Reply With Quote
Old 06-03-2013, 03:14 PM   #98
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I was mistaken. It does work in ADE. I had a typo in the CSS that caused it not to work. User error. But to be honest, I don't actually see the use for defining an ID in CSS instead of a class.

Last edited by JSWolf; 06-03-2013 at 03:23 PM.
JSWolf is offline   Reply With Quote
Old 06-03-2013, 03:40 PM   #99
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,097
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
Quote:
Originally Posted by JSWolf View Post
But to be honest, I don't actually see the use for defining an ID in CSS instead of a class.


I would surmise that "those who create the specs" wanted to keep things ordered and logical when they defined a group style vs. an individual style. In practice things don't always get used as intended, hence we have deprecated styles and tags.

I think it's just a matter of technique. I have used the tag selectors to change the way a particular item class is styled...if the change is minor, or if i need to do it to achieve specific functionality.

For example to not take up space on a page, but to get sigil to put it in the TOC.

h2[title="Copyright Page"] {display:none; margin:0}

<h2 title="Copyright Page"></h2>

Last edited by Turtle91; 06-04-2013 at 03:38 AM.
Turtle91 is online now   Reply With Quote
Old 06-04-2013, 03:21 AM   #100
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,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by JSWolf View Post
But to be honest, I don't actually see the use for defining an ID in CSS instead of a class.
Sometimes you need special values for one particular instance, and images are a common case.

Have a look at my Tom Sawyer ePub, the chapter title illustrations have a code to wrap the text around them, and since every image is a different size, the code needs to be different.

Of course, I could have created a class for each image, but creating a class for something that will never ever have more than one member is as wrong as creating a different id for things that are no different at all

So, in general I agree, classes are to be preferred, but ids have their uses too.
Jellby is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: "can only concatenate list (not "unicode") to list" bmuesse Library Management 2 01-11-2013 03:50 PM
epub "padding left" to mobi "block quote" conversion issue 1611mac Conversion 3 01-11-2012 02:10 PM
Convertion error txt to epub "IndexError: list index out of range" economix Conversion 6 12-25-2011 06:14 AM
How to remove "Fully read" books from "Last Open" list? pjeanetta PocketBook 4 12-08-2010 10:30 AM
Suggestion: Don't set "color" tag in .epub css McAlsop Calibre 16 06-17-2010 09:13 AM


All times are GMT -4. The time now is 06:15 PM.


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