2009-10-06 48 views
0

我有一個小問題與Derobin的實現大規模殺傷性武器的編輯器的一對夫婦。遇到這樣的問題與Derobins的大規模殺傷性武器

它似乎並沒有被正確格式化,我完全不知道爲什麼。雖然我不確定我是否應該在Doctype上詢問這個問題。

我用從SO基準降價文字的例子,這當然應該像下面的:

  1. 列表列表項:
    • 縮進四個空格。
      • 縮進八個空格。再次
    • 4個空格。
  2. 多個段落列表中的項目: 這是最好的縮進的段落四個空格 你可以逃脫三用,但它可以得到 混亂,當你窩其他的東西。 堅持四。

    我們縮進第一線的額外的空間來排列 它與這些段落。在實際使用中,我們可能對整個列表執行 ,以便所有項目排列。

    這一段仍然是列表項目的一部分,但它看起來凌亂人類。因此,與前兩個一樣,手動包裝嵌套段落是個不錯的主意。

  3. 塊引用列表項:

跳行和 縮進>的四個空格。

  • 列表項格式化文本:

    Skip a line and indent eight spaces. 
    That's four spaces for the list 
    and four to trigger the code block. 
    
  • 不過,我得到這個樣子的:

    Example of issue http://i35.tinypic.com/2rnj24m.jpg

    我認爲這是CSS相關的,但我不明白是什麼原因導致它。如果需要的話,我可以發佈CSS,但是我可能會發布所有這些,因爲我不確定是什麼導致了它。但是,我不確定它是否可以是實際的腳本本身(我發現可疑的示例工作,我只複製了相同的確切代碼)。

    我還應該指出,WMD下載的例子可以正常工作,但是一旦我將它添加到我的應用程序中,就會發生上述情況。

    我還應該補充說這個問題在IE7/8和Firefox 3.5中是持久的。

    任何幫助,非常感謝。


    編輯:解決出現在禁區外與添加CSS樣式OL和列表樣式位置UL的符號/編號:內;但其餘的仍然保持不變。

    編輯:根據用戶意見編輯。該HTML被輸出爲:

    <ol> 
    <li>Lists in a list item: 
    <ul><li>Indented four spaces. 
    <ul><li>indented eight spaces.</li></ul></li> 
    <li>Four spaces again.</li></ul></li> 
    <li><p>Multiple paragraphs in a list items: 
    It's best to indent the paragraphs four spaces 
    You can get away with three, but it can get 
    confusing when you nest other things. 
    Stick to four.</p> 
    
    <p>We indented the first line an extra space to align 
    it with these paragraphs. In real use, we might do 
    that to the entire list so that all items line up.</p> 
    
    <p>This paragraph is still part of the list item, but it looks messy to humans. So it's a good idea to wrap your nested paragraphs manually, as we did with the first two.</p></li> 
    <li><p>Blockquotes in a list item:</p></li> 
    </ol> 
    
    <blockquote> 
    <p>Skip a line and 
    indent the >'s four spaces.</p> 
    </blockquote> 
    
    <ol> 
    <li><p>Preformatted text in a list item:</p> 
    
    <pre><code>Skip a line and indent eight spaces. 
    That's four spaces for the list 
    and four to trigger the code block. 
    </code></pre></li> 
    </ol> 
    
    +0

    把生成的HTML可能有助於確定問題。 – 2009-10-06 18:22:34

    回答

    2
    在你的CSS文件

    你有這樣的:

    * { 
        margin:0; 
        padding:0; 
    } 
    

    這是一個普遍的復位,從一切去除空白和邊距。正如我在Doctype.com上所說的那樣。

    您將需要刪除它,並使用更可控的重置或爲ul和li設置一些默認填充和邊距。

    由於每個瀏覽器似乎都有不同的默認值,因此我傾向於從重置中忽略它們並專門設置nav ul。

    這裏我用的是復位:

    div, span, applet, object, iframe, 
    h1, h2, h3, h4, h5, h6, p, blockquote, pre, 
    abbr, acronym, address, big, cite, code, 
    del, dfn, font, img, ins, kbd, q, s, samp, 
    small, strike, sub, sup, tt, var, 
    fieldset, form, label, legend, 
    table, caption, tbody, tfoot, thead, tr, th, td { 
        margin: 0; 
        padding: 0; 
        border: 0; 
        outline: 0; 
        font-weight: inherit; 
        font-style: inherit; 
        font-size: 100%; 
        font-family: inherit; 
        vertical-align: baseline; 
        } 
    

    其復位幾乎超過列出了其他一切。

    +0

    我怎麼沒發現我不知道。謝謝。 – LiamGu 2009-10-07 11:32:25

    +0

    下次Firebug嗎? – 2009-10-08 13:34:37