アジェンダ
- HTMLのタグ
- code
- pre
- 実践
HTMLのタグ
code
文書がコンピュータ用語、ソースコードなどであることを示すタグ。
pre
HTMLファイルに記述された文書を「そのまま」表示させていることを示すタグ。
「そのまま」というのは、本来タグを使用しなければ変化しない書式などを、記載されているそのままに表示させる、ということである。
実践
上記のタグを用いて、以下のindex.htmlを作成した。
index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Lorem Ipsum</title>
</head>
<body>
<h1>Lorem Ipsum</h1>
<p>
<code>Lorem ipsum</code> dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br>
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</p>
<pre>
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</pre>
</body>
</html>
<code>を使用した箇所はフォントとサイズが変化している。
<pre>を使用した箇所は、タグを使用していないが、インデントと改行が反映され、フォントとサイズが変化している。
おわりに
今回は、文書を見やすく表示させる方法を学んだ。
内容に全く関係ないが、連日似たようなタイトルの記事を連投していたらスパムを疑われたので、投稿頻度を減し一度にまとめる内容を増やそうと思う。
次回 >> ここ