Basic knowledge of HTML


Every code of web includes a solid structure. Head, body are include in a html. In the content, one could add up title, headings and paragraphs.

Structure:
  • The DOCTYPE declaration defines the document type to be HTML
  • The text between <html> and </html> describes an HTML document
  • The text between <head> and </head> provides information about the document
  • The text between <title> and </title> provides a title for the document
  • The text between <body> and </body> describes the visible page content
  • The text between <h1> and </h1> describes a heading
  • The text between <p> and </p> describes a paragraph
Tags:
The heading defined with <h1> to <h6> tages. 
The link defined with <a>tag.
Images are defined with <img> tag, and the width and height are provided as attributes.

Attributes:
alt: Specifies an alternative text for image, when a HTML element can't be displayed.
title: Provide a tip information.
herf: Specifies a URL for a link.
id: A unique id for an element.
src: Specifies a URL for an image.
style: Specifies a CSS style for an element. (style="property:value;")
with style attribut, color, font and ect. could be defined(background-color;color;font-family;font-size;text-align).

Formatting:

Defines pre-formatted text.<pre>
Adding a head line.<hr>
Adding a line break.<br>
Bold text.<b>
Strong text.<strong>
Italic text.<i>
Emphasized text.<em>
Marked text.<mark>
Deleted text.<del>
Inserted text.<ins>
Subscripted text.<sub>
Superscripted text.<sup>

<!doctype HTML>
<html>
<head>
	<title>Page Basic.</title>
</head>

<body style = "background-color:lightgrey;">
	<h1>This is Heading 1.</h1>
	<p>This is paragraph.</p>
	<a href="http://www.google.cn/">This is a link(Edit here to modify displayed text)</a><br>
	<img src = "w3schools.jpg" alt = "W3Schools.com" width = "104" height = 142>
	<p title = "paragraph">This is a paragraph with a title.</p>
	<pre style = "color:green; font-family:courier; font-size:150%; text-align:center;">
  	My Bonnie lies over the ocean.

 	My Bonnie lies over the sea.

	My Bonnie lies over the ocean.

  	Oh, bring back my Bonnie to me.
	</pre>
	<h1 style = "color:red;">I'm a red heading</h1>
	<p>This text is normal.</p>
	<p><b>This text is bold.</b></p>
	<p><strong>This text is strong.</strong></p>
	<p><i>This text is italic.</i></p>
	<p><em>This text is emphasized.</em></p>
	<p>This text is small<small>small</small>.</p>
	<p>This text is <mark>marked</mark>.</p>
	<p>This text is <del>deleted</del>.</p>
	<p>This text is <ins>inserted</ins>.</p>
	<p>This text is <sub>subscripted</sub>.</p>
	<p>This text is <sup>superscripted</sup>.</p>
	<p>This text is <q>quoted</q>.</p>
	<blockquote cite = "http://www.w3schools.com/html/html_quotation_elements.asp">
		The HTML blockquote element defines a quoted section.
		Browsers usually indent blockquote elements.
	</blockquote>
	
</body>
</html>



References:
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值