Only first CSS class gets applied to element.
All three lines should look exactly the same, as all three CSS classes should be applied. Instead only the first class gets applied.
koreader:

Sigil/ADE/iBooks/Calibre:

CSS:
p {
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
text-align: justify;
text-indent: 1.2em;
}
p.margin {
margin-bottom: 1em;
margin-top: 1em;
}
p.noindent {
text-indent: 0;
}
p.center {
text-align: center;
}
HTML:
<p class="center margin noindent">This text gets centered</p>
<p class="noindent center margin">This text doesn't get indented</p>
<p class="margin center noindent">This text gets a margin</p>
Yeah, this one's pretty bad.
I noticed that some properties do get applied if specified as second or third class, for instance bold or underline formatting.
There has been a bad attempt at fixing this bug, which is the cause for this inconsistent behavior.
https://github.com/koreader/crengine/pull/13/commits/0930ec7230e720c148fd6f231d69558832b4d53a
Second and subsequent classes are applied by inserting spans into the markup.
Since spans are inline elements, block level properties such as margins, width, height, text-indent, etc. fail to be applied.
add support for html element that defined multiple classes example: <p class="bold italic color"></p> crengine will not match any css rules to the above example * this patch add tags after those tags with more classes * it turns the example into <p class="bold"></span class="italic"><span class="color">example</span></span></p> * it adds <div> after <div>,<span> after other tags * it does not support <img> <tr> <table> but use the first class they defined
Crengine used to support one class for each element. The patch for more than one class was not a good one. It does not really calculate the final css rules. If someone can do something about the css calculation, this one could be removed.
I will create another PR for you guys to test. it totally removed the bad fix, I found another solution to support multi classes. also I found a way to fix css rules set with id names.
here it is https://github.com/koreader/crengine/pull/72
Fixed in v2015.11-1074-g9b557ed
Most helpful comment
I will create another PR for you guys to test. it totally removed the bad fix, I found another solution to support multi classes. also I found a way to fix css rules set with id names.
here it is https://github.com/koreader/crengine/pull/72