View Single Post
Old 06-23-2013, 04:26 PM   #10
RbnJrg
Guru
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 780
Karma: 2680907
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by santosha View Post
Thanks Rubén for your input!

I guess my question is also -- do I want to use it? What's your opinion?
I don't use it The default margins and paddings are ok for me. But if you do it, is not an error.

Quote:

But my second question is then: If KindleGen, for example, converts CSS styling (such as the reset) to mobi-equivalents (where they exist), how will such a "style reset" convert over to .mobi?

Also, if I as you say might want to have an item with margins, can I override the style reset later in the CSS? I.e. does a following, specified style property override the universal selector?
If you use the universal selector to reset margins and paddings, and later, for example, you want a particular <p> tag with margins, you have to indicate it; that will override what you do with the universal selector but only for the class or the particular tag. Suppose you want a <p> with a margin-left of 1em, then you have two ways:

1. Styling "in-line":

Code:
<p style="margin-left: 1em">... some text ...</p>
2. Styling with a css stylesheet and a class:

Here in your css stylesheet you should write something like:

Code:
.ml {  /* here you can use any name */
   margin-left: 1em;
}
And in your .html page you write:

Code:
<p class="ml"> ... some text ... </p>
Of course, the second way is preferable because you can use that class with any <p>, <div>, etc. where you want a left margin of 1em. Those definitions, have priority over what you defined first with the universal selector. However, if you want to be more sure about the priority of a style, always you can use the property "!important" of that way:

Code:
.ml {
   margin-left: 1em !important;
}
But you won't need it (at least, in the cases I cited above).

Quote:
...what regulates whether KindleGen will create a KF8 file (AZW3?) or a Mobi file from what I give it to compile?...
Kindlegen will generate a book compatible for both .kf8 and .mobi (in a same book, there are two versions, one for .kf8 and another for .mobi). Of that way, if you reader is a modern one, then will read the .kf8 part of the book; on the other hand, is your reader is an old one, then will read the .mobi part of the book.

Regards
Rubén
RbnJrg is offline   Reply With Quote