您的位置:首页 > Web前端 > HTML

HTML 学习笔记(一)

2014-04-24 09:19 295 查看
<html>
<body>
<h1>Hello World!</h1>
<p> Hello World</p>
</body>

</html>


例子解释

<html> 与 </html> 之间的文本描述网页
<body> 与 </body> 之间的文本是可见的页面内容
<h1> 与 </h1> 之间的文本被显示为标题
<p> 与 </p> 之间的文本被显示为段落

HTML 标题(Heading)是通过 <h1> - <h6> 等标签进行定义的。


实例

<html>

<body>

<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<h5>This is heading 5</h5>
<h6>This is heading 6</h6>

<p>请仅仅把标题标签用于标题文本。不要仅仅为了产生粗体文本而使用它们。请使用其它标签或 CSS 代替。</p>

</body>
</html>



HTML 段落

HTML 段落是通过 <p> 标签进行定义的。
<html>
<body>

<p>这是段落。</p>
<p>这是段落。</p>
<p>这是段落。</p>

<p>段落元素由 p 标签定义。</p>

</body>
</html>



HTML 链接

HTML 链接是通过 <a> 标签进行定义的。
注释:
href 属性中指定链接的地址。

<html>
<body>

<a href="http://www.csdn.com">This is a link</a>

</body>
</html>


HTML 水平线

<hr /> 标签在 HTML 页面中创建水平线。

hr 元素可用于分隔内容。


实例

<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>



HTML 图像

HTML 图像是通过 <img> 标签进行定义的。
<html>
<body>

<img src="/i/eg_w3school.gif" width="300" height="120" />

</body>
</html>
注释:图像的名称和尺寸是以属性的形式提供的。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  HTML 网页 基础