一千萬個為什麽

搜索

每個段落標簽是否應具有CSS樣式(InDesign)?



我正在處理我的第一個epub,我想使用下面的CSS方案:

  1. Most paragraph tags would have no class assigned and would be styled by a simple rule in the style sheet...

    p {}
    
  2. A special series of paragraph tags would have a different style. However, I would put these paragraphs inside div's, so the style would just look something like this:

    div.footnote p { margin: 2px 15px; indent: 0; }
    
  3. Any remaining paragraphs that require special styling would be assigned classes. They would be the only paragraph tags with classes.

這個方案好嗎,還是有一個特殊的原因,我應該給每段段標記一個類?我在問,因為我想我記得有些關於這個教程的評論,我現在找不到。我只是想通過創建帶有空標簽的epub來確保不會造成大的失誤。

轉載註明原文: 每個段落標簽是否應具有CSS樣式(InDesign)?

一共有 2 個回答:

沒有必要給每個段落一個類,1.中的定義將適用於每個段落,帶有或不帶有標簽,並且僅適用於腳註正下方的段落,這些設置將被2的CSS取代。

您甚至可能不需要將CSS設置為1,而是使用ePub閱讀器的默認設置。

正如安森所說,如果該段落不需要以某種特定的方式,與其他段落不同,就不需要對每一段落應用一個類別。

例如,

這是一個沒有關聯風格的簡單段落

,這是完全可以接受的。

This is a bit beyond the scope of your question, but it is related to "default" text and could be handy to know: if you need to define a default style for all your text (

, <div>,

... you got the point), you can define the custom styling to apply to the html <body> tag, in example

body {
    font-family: arial, helvetica, sans-serif;
    text-align: justify;
    font-size: 1.2em;   
}

it will set the base style of the text, when not given a different one with more specific tags.

Again, this is not required, most of the times you won't need to set this at all. You should only define it if you don't want your text to use the default settings of the e-reader.