1. ホーム
  2. Web制作
  3. HTML/Xhtml

HTML独習ツアー(I)基本要素と属性の演習(自作コード編)

2022-01-28 05:12:18
W3schoolのチュートリアルに従いましたが、個人的にはチュートリアルは非常に良いと思います。
演習1
コピーコード
コードは以下の通りです。

<html>
<body bgcolor="yellow">
<h1 align="center">This is heading 1</h1>
<h2 align = "left">This is heading 1</h2>
<h3 align = "right">This is heading 1</h3>
<h4>This is heading 1</h4>
<h5>This is heading 1</h5>
<h6>This is heading 1</h6>
<! --<h7>This is heading 1</h7>-->
<! --<h7>This is heading 1</h7>-->
<p>This is the first paragraph
</p>
<hr /> This is the link area
<a href="http://www.baidu.com">This is baidu link</a>
<br/>
<a href="http://www.w3school.com.cn">This is w3school link</a>
<hr />This is the image area
<img src = "http://img.t.ifeng.com/201010/22/12/96x96_1758293e995c.jpg" />
<hr /> This is the table area
<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<hr /> Line feed function
<p>This sentence
Line break here
</p>
<p>
This paragraph There are many
blank lines
Or spaces
But browsers automatically ignore
They are automatically ignored by the browser
</p>
<pre>
This is the pre-formatted text
You can display blank lines
and spaces
And the code
</pre>
<pre>
while(true)
{
sum=a+b;
return sum;
cout<<sum;
}
</pre>
</body>
</html>

演習2
コピーコード
コードは以下の通りです。

<html>
<body>
<b>This text is bold</b>
<strong>This text is strong</strong>
<big>This text is big</big>
<small>This text is small</small>
<em>This text is emphasized</em>
<i>This text is italic</i>
This text contains<sub>subscripts</sub>
This text contains<sup>superscript</sup>
<hr />
<pre>
This is the pre-formatted text
Haha
Can output spaces
Blank lines, right?
</pre>
<code>
while(true)
{
computer code;

</code>
<kbd>keyboard input</kbd>
<samp>Sample text</samp>
<var>Computer variable</var>
<hr />
Address Exercise.
<address>
SHUDIP, Tianjin
FERT R
ABC (Receive)
Zip code: 123456
</address>
<hr /> Abbreviation exercise
<abbr title = "etcetera">etc.</abbr>
<acronym title = "World Wide Web">www.</acronym>
<hr />Text direction exercise // That's not supported here, right-to-left text should be output
<bdo dir="rt1">Here is some text</bdo>
<hr />Block citation exercise
This is a long quote
<blockquote>This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is the long quote. This is the long quote. This is the long quote. This is a long quote.
This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is the long quote. This is a long quote.
This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote. This is a long quote</blockquote>
This is a short quote
<q> short quote wow, short quote</q>
<hr />Delete or add text effects practice
<p>A dozen have <del>twenty </del><ins>twelve </ins>oh</p>
</body>
</html>

超簡単なんだろうな、おい、頑張れ!