HTML_<html>\<head>\<body> tags detailed

<html> and </html> define the start and end points of the document.

<html> tag details:


    The dir attribute specifies which direction the browser should use to display the text contained in the element. The specific display effect depends on the browser's support for HTML4. ltr: display from left to right, rtl: display from right to left; the lang attribute specifies the language used in the document currently containing the lang attribute tag; the version attribute specifies the version of the HTML standard that currently authores the document -> this attribute has basically Obsolete, use the <!doctype> tag, which is indicated at the head of the document.


Code example:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
...
</head>

<body>
document body
</body>
</html>


<head> tag details:


    It is worth noting that the <head> tag usually contains (nested) <meta> tags to tell the browser additional information about the document; the profile attribute provides the URL of the profile associated with the current document, while The format of the URL and the way browsers use it is not yet defined, so this property is mostly a placeholder reserved for future development.

Code example :

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>maxin's html file</title>
</head>

Additional tags included between the <hea d> and </head> tags:

<title> tag: It is the only required content in the <head> tag, which sets the title of the document displayed on the browser tab. (attribute: dir\lang)

<base> tag: Provides the base URL (absolute address) to resolve all relative addresses and should only appear at the head of the document.

<head>
<base href ="/new/" //Specify the base URL of the document
       target ="window_name" //Define the window to open the page. Attribute value: _parent: open in the previous window
                                   // _blank: open in a new window _self: open in the same window
</head> //_top: Open in whole window in browser (ignore any frame)
<basefont> tag: Set the base font, font size and color . Once other tags in the page do not define the style of the text or paragraph, the base font will be applied.

                standard text style. (attributes: face (font), size (size -1~+7), color (color))

<meta> tag: defines the name/value pair associated with the document. (property: http-equiv/name/content)

<meta name="keywords" content="图书,培训,设计">



<body>标签详解:
    此标签界定了文档的主体。<body>和</body>之间有很多的属性来控制文档的颜色和背景等,不同的浏览器有其不同的扩展标签。


背景颜色:

    将浏览器的标准背景颜色改成另外一个色调的时候,一种标准但是不推荐使用的方法是利用bgcolor属性进行<body>标签的设置。

<body bgcolor="#CC9900">//背景设置成暗黄色

背景图像:

    单纯一种颜色不能烘托效果的时候,通过background属性可进行body图片设置,属性值需要的是图片的URL,同时,默认情况下图片会平铺整个窗口。

<body background="text/3.gif" bgcolor="#CC9000">
背景图像固定:

    使用的是bgproperties属性,此属性只有一个属性值fixed,并且只有和background属性一起使用的时候才有效,作用是将图片冻结在浏览器窗口中。

<body background="text/3.gif bgproperties="fiixed"">
正文的颜色:

    text属性是设置整个文档所有无连接文本的颜色,text的属性值为RGB组合或者颜色名称

<body bgcolor="blue" text="#777700">
链接颜色:
    在<body>标签中,link\vlink\alink属性控制着文档中超链接文本(<a>)的颜色,属性值的设置如同正文的颜色设置。link:还没有单击过的超链接的颜色 vlink:单击过的超链接的颜色 alink:激活超链接时文本的颜色

<body background="text/3.gif" bgcolor="#ffffff" link="#006699" alink="#33CCFF" vlink="#CCCCCC"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325711625&siteId=291194637
Recommended