ข้ามไปเนื้อหา

แม่แบบ:ลอยเหนือรูป/doc

จาก วิกิซอร์ซ


วัตถุประสงค์

[แก้ไข]

ใช้สร้างสิ่งลอยเหนือรูป (อาจเป็นข้อความ หรืออาจเป็นรูปภาพอื่น เป็นต้น)

วิธีใช้

[แก้ไข]

ใช้โค้ดดังนี้

{{ลอยเหนือรูป
| image = 
| width = 
| item1 = 
| hpos1 = 
| vpos1 = 
| x1 = 
| y1 = 
| width1 = 
| height1 = 
| border1 = 
| ts1 = 
}}

คำอธิบาย

[แก้ไข]
  • image: ใส่รูป ด้วยรูปแบบ [[ไฟล์:...]] เหมือนการใส่รูปทั่วไป
  • width: ความกว้างของพื้นที่ที่จะมีการลอย ถ้าปล่อยว่างไว้ จะใช้ขนาด 400 โดยอัตโนมัติ
  • itemแม่แบบ:Sub: The item to be overfloated. If text, the templates {{block left}}, {{block center}} or {{block right}} are useful.
  • hposแม่แบบ:Sub: (Optional) Sets the horizontal edge position of the item to either left or right. Defaults to left.
  • vposแม่แบบ:Sub: (Optional) Sets the horizontal edge position of the item to either top or bottom. Defaults to top.
  • xแม่แบบ:Sub: (Optional) Sets the size of the margin of the horizontal position. Defaults to 0.
  • yแม่แบบ:Sub: (Optional) Sets the size of the margin of the vertical position. Defaults to 0.
  • widthแม่แบบ:Sub: (Optional) Sets the horizontal size of item block. No default.
  • heightแม่แบบ:Sub: (Optional) Sets the vertical size of item block. No default.
  • borderแม่แบบ:Sub: (Optional) Sets the border style of item block (debugging aid). No border by default.
  • tsแม่แบบ:Sub: (Optional) If set, render item block in a table cell, which is passed a single {{ts}} directive. Useful values are currently "top", "middle" or "bottom" to select vertical alignment style. No table cell by default.

All numbered parameters have eleven instances, numbered 1 to 11 respectively. These are only used if the corresponding item is used. Eg. x2 and y2 are only used if item2 is coded.

Examples

[แก้ไข]
{{overfloat image
| image = [[ไฟล์:Amazing Stories v01n01 p092 The Facts in the Case of M Valdemar.png|400px|center]]
| item1 = {{block left
| width = 160px
 |{{gap}}{{x-larger|''The''}} {{xx-larger|{{sc|'''Facts'''}}}}<br />{{x-larger|''in the''}} {{xx-larger|{{sc|'''Case'''}}}} {{x-larger|''of''}}<br />{{xx-larger|{{sc|'''M. Valdemar'''}}}}
{{c|{{larger|''by''}}}}
{{larger|''Edgar Allan Poe''}}
 }}
| y1 = 50
}}
The Facts
in the Case of
M. Valdemar
by

Edgar Allan Poe

{{overfloat image
| image = [[ไฟล์:WeirdTalesv24n3pg352 Trail of the Cloven Hoof.png|center|600px]]
| width = 600
| item1 = {{block center|width=150px|{{larger|By ARLTON EADIE}}}}
| x1 = 230
| y1 = 0
| item2 = {{block right|width=175px|{{smaller|"One look was enough. I snapped off my flashlight and fled."}}}}
| hpos2 = right
| y2 = 425
}}

By ARLTON EADIE

"One look was enough. I snapped off my flashlight and fled."
  • This example shows how to dynamically vertical centre a text block within a frame.
{{overfloat image
| image = [[ไฟล์:The Pathway of Roses, Larson (1913) decoration on page 5.jpg|frameless|center|400px]]
| item1 = <div style="line-height:1.5; text-indent:1em; margin-left:0; font-style:italic;
font-size:92%; text-align:justify;"><div>''To give the world emancipation is the ruling desire of all<!--
--> minds that are spiritually awakened; and these should remember that to overcome evil with good is the only way.<!--
--> Forget the wrong that may appear in the outer world of things, and give all your thought to the great good that is<!--
--> inherent in all things. You thereby place in action the greatest emancipating power that the human race will ever<!--
--> know.''</div>
<div>''We are in bondage because we have lived to please the person. Follow the soul and freedom shall come quickly.<!--
--> Then we shall please the person better than ever before. To follow the soul is to enter the greater domains of life,<!--
--> those domains from which we may secure everything that is rich and beautiful and superior in human existence. The<!--
--> soul leads, not only into the life more abundant, but also into the actual possession of all the spiritual riches<!--
--> that the greater life may contain. And when we find the kingdom that is within, all that we may desire in the<!--
--> without shall be added.''</div>
<div>''The soul that lives most perfectly in the present, creates most nobly for the future. Be yourself to-day,<!--
--> regardless of what happened yesterday. Be all that you are or can be to-day, and you will live in a fairer world<!--
--> to-morrow.''</div></div>
| x1 = 50
| y1 = 50
| height1 = 553
| width1 = 300
| ts1 = middle
}}
To give the world emancipation is the ruling desire of all minds that are spiritually awakened; and these should remember that to overcome evil with good is the only way. Forget the wrong that may appear in the outer world of things, and give all your thought to the great good that is inherent in all things. You thereby place in action the greatest emancipating power that the human race will ever know.
We are in bondage because we have lived to please the person. Follow the soul and freedom shall come quickly. Then we shall please the person better than ever before. To follow the soul is to enter the greater domains of life, those domains from which we may secure everything that is rich and beautiful and superior in human existence. The soul leads, not only into the life more abundant, but also into the actual possession of all the spiritual riches that the greater life may contain. And when we find the kingdom that is within, all that we may desire in the without shall be added.
The soul that lives most perfectly in the present, creates most nobly for the future. Be yourself to-day, regardless of what happened yesterday. Be all that you are or can be to-day, and you will live in a fairer world to-morrow.