ArticleDirectory
<Base target = "_ blank">Open link in new window
OneHtmlCan have multiple<Head>Tag?
1. htmlInXmlnsAttribute
XmlnsAttributes can be defined in the document as one or more selectable namespaces. This attribute can be placed in the start tag of any element in the document. The value of this attribute is similarURLIt defines a namespace, And the browser will use this namespace for all content in the element where the property is located.
For exampleIf you need to useXMLStandardizedXHTMLIn<HTML>Use at least oneXmlnsAttribute to specify the main namespace used by the entire document:
1.<HtmlXmlns = "http://www.w3.org/1999/xhtml">
2.If you wantDivIf a mathematical formula is displayed in the elementDivThe element defines a mathematical namespace. For example:
3.<DivXmlns = "http://www.w3.org/1999/Math/MathMl"> X3/x </div>
4.If you do not wantDivElement DefinitionXmlnsAttribute, the better way is to define a namespace with a prefix at the beginning of the document:
5.<HtmlXmlns = "http://www.w3.org/1999/xhtml">
6.Xmlns: Math = "http://www.w3.org/1999/Math/MathMl">
7.Then, you canDivThe prefix is used, as shown in the following code:
8.<Math: Div> X3/x <div>
9.Although in most cases, the vast majorityXHTMLThe author does not need to define multiple namespaces, but it is still necessary to understand that there are multiple namespaces so thatDTDContent embedded in otherDTDYou can manage multiple namespaces in the defined content.
XmlnsYesXHTML namespace.
Role:XMLYou can define your own tags, but the tags you define may be the same as those defined by others, but they indicate different meanings. Errors may occur when documents are exchanged or shared. To avoid such errors,XMLThe namespace Declaration allows you to identify your tag through a URL.
XHTMLYesHtmlFirstXMLExcessive markup language, which must complyXMLDocument rules. Therefore, you also need to define the namespace becauseXhtml1.0User-Defined identifiers are not allowed. Therefore, the namespace is the same, that is:Http://www.w3.org/1999/xhtml
2.
<A>
Link to different locations on the same page
The definition is as follows:CD3Is the link locationNameValue
<A href = "# CD3">This is the link1 </a>
The following is the link location.
<H1> <a name = "CD3">This is the anchor Link</A>
Link to the corresponding location of different pages.
Define the corresponding position of the anchor point to the page:
<A name = "local"> </a>
2.InJSDefining methods inTest ()
This. loction. href = "# local"
InBodyDefine attributes inOnload = "test ();"//Not recommended
The simplest way is to directlyHref = ""Add# Local
For exampleWww.test.html # localThis will jump to the pageTestOfLocalLocation
Using images as hyperlinks
<A href = "www.baidu.com">
</a>
Create email link
Mailto: Is the key word used to create an email link.
CCYes CC
BCCIs BCC
SubjectYesmail title
BodyIs the mail body
<A href = "mailto: heshan871897519@126.com? Cc = heshan@126.com & BCC = 871897519@126.com & subject = Hello % 20 again & Body = I % 20 love % 20you ">Send email</A>
<A target>
Open new window
The pointed hyperlink makes it easy to create an efficient browser tool. For example, a simple list of content documents can redirect documents to a separate window:
<H3> table of contents
<Ul>
<Li> <a href = "pref.html"Target = "view_window"> Preface </a> </LI>
<Li> <a href = "chap1.html"Target = "view_window"> Chapter 1 </a> </LI>
<Li> <a href = "chap2.html"Target = "view_window"> Chapter 2 </a> </LI>
<Li> <a href = "chap3.html"Target = "view_window"> Chapter 3 </a> </LI>
</Ul>
When you select a link in the content list for the first time, the browser opens a new window and marks it"View_window"And then display the content of the document to be displayed. If you select another link from the content list and"View_window"When the file is still in the open state, the browser will load the selected file into that window again to replace the previous documents.
Throughout the process, the window containing the content list is accessible to users. You can click a connection in the window to change the content of the other window.