Bản_mẫu:Anchor

The template {{anchor}} inserts one or more invisible HTML fragment identifiers (anchor names) in a page. Those locations can then be linked to using [[#Location|...]] syntax (note that #Location here is not a browser instruction like #redirect—the word "Location" can be any word you wish to associate with any part of an article in which you decide to place the {{anchor}} template, and can be entirely arbitrary; also, the first letter of the location is usually capitalised to reflect the common capitalisation used in section headers—see MOS:HEAD for more on this style guideline).Anchors may be used within tables, subject to certain restrictions. The {{anchor}} template may be used in the caption and cells of a table, but not those portions of a table that are outside the caption and cells. It is used on the table's caption thus:|+ {{anchor|FooX}} A table caption and the following forms of cell are valid:!{{anchor|Foo1}} A header cell !style="background:white;" |{{anchor|Foo2}} A header cell with styling |{{anchor|Foo3}} A data cell |rowspan=2 |{{anchor|Foo4}} A data cell spanning two rows You need to ensure that the {{anchor}} is not in that portion of the markup intended for the classes, styles etc. Thus, {{anchor}} cannot be placed anywhere on lines that begin with {| (start of table) or |- (new row), and the following forms of cell are not valid:!{{anchor|Foo1}} |A header cell !style="background:white;" {{anchor|Foo2}} |A header cell with styling |{{anchor|Foo3}} |A data cell |rowspan=2 {{anchor|Foo4}} |A data cell spanning two rows If it is necessary for an anchor to be in any of these positions, a different technique is used—the id= attribute. This is placed in that portion of the markup where the classes, styles etc. may be used, as follows:{| id=FooX class=wikitable |- id=FooY !id=Foo1 |A header cell !style="background:white;" id=Foo2 |A header cell with styling |id=Foo3 |A data cell |rowspan=2 id=Foo4 |A data cell spanning two rows The id= attribute may appear before, between or after any other attributes that may be present, but only one id= attribute may be used in each of these areas.Dữ liệu bản mẫu cho AnchorThe template {{anchor}} inserts one or more HTML anchors in a page. Those locations can then be linked to using [[#location|...]] syntax. The parameters labels shown here (e.g., 'First anchor', '1', and the rest) are provided for convenience; no parameter label is required in the template itself, so you may create an anchor within an article by typing {{anchor|go here}} or {{anchor|this is it}} rather than {{anchor|First anchor=go here}} or {{anchor|1=this is it}} (though both formats will work correctly). You may not use {{anchor}} all by itself, however, as this is like dropping a ship's anchor without tying a rope to it: it holds nothing in place, can't be found or used, and messes up the sea floor with garbage!Tham số bản mẫuFirst anchor value; Only the first anchor is required.Second anchor.Third anchor.For additional anchors, just add additional anchors (the template isn't limited to three)

Liên quan