HTML header element
HTML element
element is a container for all head elements. The head element tag content includesSet the base URL through the above code. The address of any hyperlink in the Base.htm page will be preceded by "//m.sbmmt.com", which is converted to an absolute address. Moreover, the hyperlinks on the page are opened in new windows.
Knowledge point 2: Meta-information tag of header information
Meta-information tag is the basic of header information Tags and professional webpage codes have detailed settings for meta information. The meta information tag is , which is a single tag. The information provided by the Meta element is invisible to browsing users and is generally used to define the name, keywords, author, etc. of page information. In an HTML page, a meta tag contains a meta content, and there can be multiple meta elements in an HTML header page.
meta tag attributes are divided into two types: page description attribute (name) and http title information (http-equiv).
name attribute
The name attribute is mainly used to describe the content of the web page and is used for search engine optimization. It must be mastered. Set the name attribute correctly so that the search robots of search engines (such as Google and Baidu) can find and classify the web pages. Search engines will generally automatically find the meta value to classify web pages. The value of name is as follows:
<1>keywords. That is, keywords are used to describe the keywords and other information contained in the web page, thereby increasing the probability of being searched by search engines. The writing format is , and the value of the content attribute is the specific keyword set by the user. (Generally, multiple keywords can be set, separated by English half-width commas. Search engines limit the number of keywords, so the keyword content should be concise and concise)
<2>description. It means "description" in Chinese and is used to describe the main content, theme, etc. of a web page. Reasonable settings can also increase the probability of being searched by search engines. The format is . The content attribute value is the specific description of the page set by the user. It can accommodate up to 1024 characters, but the search engine only displays about the first half of the page. 175 characters.
<3>author. Author, used to set the name of the website author, often used by more professional websites. The format is
http-equiv attribute
The value of the http-equiv attribute is as follows :
<1>content-type, content category, used to set the category and language character set of the page. Writing format , the value of the content attribute represents that the page is output in HTML code, and the character set is gb2312 (Simplified Chinese) , for international website development, in order to unify characters, it is recommended to use utf-8.
<2>refresh for charset. Refresh is used to set how long the webpage refreshes itself, or automatically jumps to other pages within a period of time. The first writing format means interval Refresh once every 30 seconds. The second writing format is , which means the page will automatically jump to www.google after 30 seconds. com website
Knowledge point three: header information implementation and mixing with CSS and JavaScript
CSS is responsible for the style of the HTML web page, and JavaScript is responsible for the HTML Dynamic behavior of web pages. The most common way to integrate CSS and JavaScript is to write the header information.
<1>To add CSS, just add the tag pair in the header information. The sample code is as follows
CSS的设置
<2>To add JavaScript, just add