HTML自学之旅(一)基本元素与属性练习(自写代码)

发布时间:2022-04-12 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了HTML自学之旅(一)基本元素与属性练习(自写代码)脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我是按照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>-->
<!--再来个注释,试一下效果 -->
<p>This is the First paragraph
</p>
<hr />这是链接区域

<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 />这是图片区域

<img src = "http://img.t.ifeng.com/201010/22/12/96x96_1758293e995c.jpg" />
<hr />这是表格区域
<table border="1">
<tr>
<th>;month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<hr />换行功能
<p>这句话
在这里换行
</p>
<p>
这个段落 有很多
空行
或者空格
但是浏览器自动 忽略
了它们
</p>
<PRe>
这是预格式文本
可以显示空行
和空格
还有代码
</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>下标</sub>

This text contains<sup>上标</sup>
<hr />
<pre>
这是预格式文本
哈哈
可以输出空格
空行吧
</pre>
<code>
while(true)
{
computer code;
}
</code>
<kbd>keyboard input</kbd>

<samp>Sample text</samp>

<VAR>Computer variable</var>
<hr />
地址练习:
<address>
天津市SHUDIP

FERT R

abc(收)

邮编:123456
</address>
<hr />缩写练习

<abbr title = "etcetera">etc.</abbr>

<acronym title = "World Wide Web">www.</acronym>
<hr />文字方向练习//这里不支持那个功能吧,本应该是从右向左输出文字

<bdo dir="rt1">Here is some text</bdo>
<hr />块的引用练习

这是长引用
<blockquote>这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用
这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用。这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用
这是长引用.这是长引用.这是长引用.这是长引用.这是长引用.这是长引用</blockquote>
这是短引用
<q>短引用哇,短引用</q>
<hr />删除或添加文字效果练习
<p>一打有<del>二十</del><ins>十二</ins>个哦</p>
</body>
</html>

肯定是超级简单啦,嘿嘿,坚持!

脚本宝典总结

以上是脚本宝典为你收集整理的HTML自学之旅(一)基本元素与属性练习(自写代码)全部内容,希望文章能够帮你解决HTML自学之旅(一)基本元素与属性练习(自写代码)所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。