Home >Web Front-end >HTML Tutorial >HTML document basics_html/css_WEB-ITnose
1. HTML (Hyper Text Markup Language) is a simple markup language used to create hypertext documents. HTML writes various tags in the text of the text and compiles them through a web browser. and execution to display correctly. This article mainly introduces the basics of HTML documents and common tags. The content framework of this article is as follows, but only the basics of HTML documents are introduced first:
The above picture is among the common tags of HTML documents. I missed one multimedia mark, please forgive me!
1. HTML document basics:
1.1 HTML markup: HTML is Hypertext Markup Language. It mainly consists of two parts: text and markup. HTML tags usually consist of "6745434bf92a2979d589ede8e8e7bea9" and the tag elements contained therein. For example: 6c04bd5ca3fcae76e30b72ad730ca86d36cc49f0c466276486e50c850b7e4956 is a pair of tags. This tag is called a body tag and is used to indicate the main content of the document.
(1). In HTML hypertext markup language, most tags appear in pairs, generally consisting of a start tag and an end tag, where the start tag tells the web browser to start from here Begins the function represented by the tag, and the end tag tells the web browser to end the function here. This type of tag is called "double tag", and its syntax format is as follows:
3fe3bf92e801c8038a0a384ffa6c8e8eContent191017c900adde635c3a843962135b18
The "content" part is to be marked by this pair The functional part, such as outputting the square of y on the page, can be achieved through the 2cdea26b4c3988e37d674b56660962a72eb235f530502820017cce1685312d59 tag.
(2). Then attach an example of "double markup", start the Dreamweaver CS5 tool, you can also use other tools to write web pages, select HTML in the create new project, and write in the "Code" window The following code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>输出y的平方</title></head><body>输出y的平方:y<sup>2</sup></body></html>
Then create a new site, click the site on the toolbar, and then select:
Then save this web page to this site and change the name to sup .html, the operation effect is as follows:
(3). Although most tags in HTML hypertext markup language are "double tags", some exist in separate forms. tags, such tags are called "single tags". This type of tag can fully express its meaning when used alone. The syntax format is: 8bf259f5a6144433b921fb8b7de94970
In HTML hypertext markup language, the most commonly used "single tag" is 0c6dc11e160d3b678d68754cc175188a , this mark is a newline mark. In fact, writing 076402276aae5dbec7f672f8f4e5cc81 can also achieve the effect of line break.
(4). Next is an example of "single markup". Usually, one line is used to display a paragraph of text on the page. Since this line of text is too long, the page looks very unsightly. In this case, a single markup can be used. 0c6dc11e160d3b678d68754cc175188a This text is divided into two lines to display. The code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>单标记</title></head><body>梦想遥不可及,但是不可放弃<br>只要再坚持一下,成功的路就在脚下!</body></html>
Then save it to the JavaScript site and change it to br.html. After running, it is as follows:
(5). Some attributes can usually be included in the start tag using most single tags and double tags. The syntax format is: 7086e9d429cb73bd86fd6b9a926dd9b3
In the above syntax, all attributes must be written in the angle brackets "733e3fab250f9f03953e3a7dbb521cfb to draw a horizontal line on the page, and set its size attribute, noshade attribute, width attribute and color attribute. , the code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>绘制一条水平线</title></head><body><hr size="6" noshade="noshade" width="70%" color="#CCFF55"></body></html>
The size attribute in the code represents the thickness of the horizontal line, the noshade attribute represents removing the shadow of the horizontal line, the horizontal line defaults to a hollow three-dimensional effect with shadow, and the width attribute represents the width of the horizontal line. The color attribute represents the color of the horizontal line.
Save this file to the site and change the file name to br.html. The running effect is as follows:
1.2 Basic structure of HTML document: A hypertext file written in HTML language is called an HTML file. You can manually write HTML files directly in a text editor under Windows, or you can use visual editing software such as FrontPage and Dreamweaver to write HTML documents.
(1). In HTML hypertext markup language, three tags are defined to describe the basic structure of the page. The basic structure in HTML is as follows:
<html><head>...头部信息<body>...主体内容</body></head></html>
(2). The functions and usage of various tags are introduced in detail below:
? 100db36a723c770d327fc0aef2ce13b1...73a6ac4ed44ffec12cee46588e518a5e Tag: The first tag in an HTML document. This tag is used to indicate that the document is an HTML document. When the browser encounters the 100db36a723c770d327fc0aef2ce13b1 tag, it will interpret the text according to HTML standards. The closing tag 73a6ac4ed44ffec12cee46588e518a5e appears at the end of the HTML document.
? 93f0f5c25f18dab9d176bd4f6de5d30e...9c3bca370b5104690d9ef395f2c5f8d1标记:此标记出现在100db36a723c770d327fc0aef2ce13b1标记内起始的部分,此标记称为头部标记。头部标记用于提供与Web页面有关的各种信息。在头部标记中,可以使用e8e496c15ba93d81f6ea4fe5f55a2244标记模拟HTTP协议的响应头报文,用于鉴别作者、标注内容提要和关键字、设定页面字符集、刷新页面等,在HTML头部可以包括任意数量的e8e496c15ba93d81f6ea4fe5f55a2244标记;使用b2386ffb911b14667cb8f0f91ea547a7...6e916e0f7d1e588d4f442bf645aedb2f标记来指定网页的标题;使用c9ccee2e6ea535a969eb3f532ad9fe89...531ac245ce3e4fe3d50054a55f265927标记来定义CSS样式表;使用3f1c4e4b6b16bbbd69b2ee476dc4f83a...2cacc6d41bbb37262a98f745aa00fbf0标记来插入脚本语言等。一般来说,位于头部标记中的内容都不会在网页上直接显示。
? 6c04bd5ca3fcae76e30b72ad730ca86d...36cc49f0c466276486e50c850b7e4956标记:此标记称为主体标记,在头部标记9c3bca370b5104690d9ef395f2c5f8d1之后。它定义了HTML文件显示的主要内容和显示格式。作为网页的主体部分,此标记有很多内置属性,这些属性用于设定网页的总体风格。例如,定义页面的背景图像、背景颜色、文字颜色以及超文本链接颜色等。
(3).接下来附上一个使用240cb830ca84ebaabbd07850110b414d...e6e38b3c62e8df885fe2e3986461aa63标记的例子,240cb830ca84ebaabbd07850110b414d标记应用于HTML文件的主体标记6c04bd5ca3fcae76e30b72ad730ca86d与36cc49f0c466276486e50c850b7e4956之间,并且只影响它所标识的文字。
这里例子通过240cb830ca84ebaabbd07850110b414d标记的face属性定义字体为“黑体”,通过size属性定义大小为“16px”,通过color定义颜色为蓝色,代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>定义文字字体</title></head><body>应用<font>标记来定义文字字体:<br><font face="黑体,宋体" size="16px" color="#3399FF">蓝色的天空下,让我们一起飞翔!</font></body></html>
保存此文件为font.html到站点下,运行后如下:
这个例子中,使用了<和>来输出"33abac5f5e8ac9e2167dd683134404c5"这些符号,即在HTML中为一些特殊的字符设置了特殊的代码。字符的实体名称都以一个“&”符号开始,以一个“;”符号结束。在这个例子代码中,,特殊符号“e7139c17a1343ff0fec7f2cdb89f92d2”用>标记表示。其中还有很多特殊的代码,如 代表空格,"代表英文半角的""双引号等等。
二.此篇文章介绍了HTML文档的基础,HTML文档的常用标记下次再介绍了,以上内容仅供大家学习参考,写得不好,请见谅,如有错误,请指出,谢谢!
??
版权声明:本文为博主原创文章,未经博主允许不得转载。