0
私のコードを強調するためにHighlightJSを使用しています。プレタグとコードタグの間隔をリセットするにはどうしたらいいですか?プレタグとコードタグのパディングと余白の両方を0に設定しましたが、うまくいかないようです。理想的には、コードタグがpreタグの完全な高さを占めるようにしたいと思います。どうすればいいのか教えてください。コードタグが親タグの高さの100%を占めていない
pre{
background: gray;
margin: 0 !important;
padding: 0 !important;
}
code{
margin: 0 !important;
padding: 0 !important;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/styles/color-brewer.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.4.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<pre>
<code class="html">
<!DOCTYPE html>
<html>
<title>HTML Tutorial</title>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
</code>
</pre>