2016-04-19 13 views
0

私は新しいプロジェクトを開始しているので、今日はGoogleのプリテイプリントツールを使い始めましたが、数字が行くはずの不要な埋め込みがあるようですが、私はあまりよく分かりません。GoogleプレPT掲示板を削除しますか?

とにかく、このパディング/マージンを削除するにはどうすればよいですか?

私はpadding: 0 !important;margin: 0 !important;text-align: left !important;float: left !important;などのものを試しましたが、役に立たないです。

画像例:

Image Example

コード:

<!DOCTYPE html> 
<html> 
    <head> 
    <script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?lang=css&amp;skin="></script> 
    <style> 
     table { 
     border: 0; 
     width: 100% 
     } 

     th { 
     text-align: left; 
     } 

     #code-box { 
     border-left: 5px solid #5C00AC; 
     } 

     #no-border { 
     border: none !important; 
     } 

    </style> 
    </head> 
    <body> 
    <h1>ModPE API</h1> 
    <br> 
    <h2>Members</h2> 
    <hr> 
    <h4 style="margin-bottom:0px;">ArmorType</h4> 
    <p>Armor Types.</p> 
    <br> 
    <table> 
     <tr> 
     <th>Name</th> 
     <th>Type</th>  
     <th>Description</th> 
     <tr> 
     <td>helmet</td> 
     <td>int</td> 
     <td>0</td> 
     </tr> 
     <tr> 
     <td>chestplate</td> 
     <td>int</td>   
     <td>1</td> 
     </tr> 
     </tr> 
     <tr> 
     <td>leggings</td> 
     <td>int</td> 
     <td>2</td> 
     </tr> 
     <tr> 
     <td>boots</td> 
     <td>int</td>   
     <td>3</td> 
     </tr> 
    </table> 
    <h4>Example:</h4> 
    <div id="code-box"> 
     <pre class="prettyprint" id="no-border"> 
     print(ArmorType.chestplate); 
     </pre> 
    </div> 
    </body> 
</html> 

答えて

3

スペースは、あなたのHTML内の空白文字によって引き起こされます。 CSSを編集する必要はありません。

変更この:これに

<pre class="prettyprint" id="no-border"> 
    print(ArmorType.chestplate); 
    </pre> 

<pre class="prettyprint" id="no-border">print(ArmorType.chestplate);</pre> 
+1

私はばかだと思うXDありがとう! – ItzJavaCraft

0

あなたが読みやすくするためにインデントをしたい場合は、同様の効果がキャリッジリターンの後に空白を除去することにより、単に達成することができます。ちょうど明確にするために、プレオープンタグと終了タグの前に空白がないようにする必要があります。

<pre class="prettyprint" id="no-border"> 
    print(ArmorType.chestplate); 
</pre> 

<!-- Becomes --> 

<pre class="prettyprint" id="no-border"> 
print(ArmorType.chestplate); 
</pre> 
関連する問題