Test:修订间差异

来自PD2汉化wiki
跳转到导航 跳转到搜索
Lil174留言 | 贡献
无编辑摘要
Lil174留言 | 贡献
无编辑摘要
 
(未显示同一用户的11个中间版本)
第1行: 第1行:
<templatestyles src="SomeStyles.css" />
Create a horizontal layout with flexible boxes:
<div style="display: flex; gap: 10px; margin: 10px 0;">
  <div style="flex: 1; padding: 10px; background: #f0f0f0; border-radius: 5px;">Box 1</div>
  <div style="flex: 1; padding: 10px; background: #f0f0f0; border-radius: 5px;">Box 2</div>
</div>


<ref name="Rathma">拉斯玛</ref>
Items wrap on smaller screens and have a minimum width:
<div style="display: flex; flex-wrap: wrap; gap: 15px; justify-content: center;">
  <div style="flex: 1 1 250px; padding: 15px; background: #e3f2fd;">Item 1</div>
  <div style="flex: 1 1 250px; padding: 15px; background: #e3f2fd;">Item 2</div>
  <div style="flex: 1 1 250px; padding: 15px; background: #e3f2fd;">Item 3</div>
</div>


<poem>
Use flex-direction: column for vertical alignment:
A stately pleasure-dome decree:[[File:123.png]]
<div style="display: flex; flex-direction: column; gap: 8px; max-width: 300px;">
Where Alph, the sacred river, ran
  <div style="padding: 8px; background: #ffebee;">Row 1</div>
Through caverns measureless to man
  <div style="padding: 8px; background: #ffebee;">Row 2</div>
Down to a sunless sea.
</div>


So twice five miles of fertile ground
Center-align items vertically and horizontally:
With walls and towers were girdled round:
<div style="display: flex; justify-content: center; align-items: center; height: 200px; border: 1px dashed #ccc;">
And there were gardens bright with sinuous rills,
  <div>Centered Content</div>
Where blossomed many an incense-bearing tree;
</div>
And here were forests ancient as the hills,
Enfolding sunny spots of greenery.
</poem>


<center>
Create a reusable template (e.g., Template:FlexContainer):
LU左上 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-lu">[[File:田字图.png|128px]]</div></div>
<includeonly>
UC上中 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-uc">[[File:田字图.png|128px]]</div></div>
<div style="display: flex; gap: {{{gap|10px}}}; flex-wrap: {{{wrap|nowrap}}}; margin: {{{margin|10px 0}}};">
RU右上 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-ru">[[File:田字图.png|128px]]</div></div>
  {{{1}}}
<br>
</div>
LC左中 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-lc">[[File:田字图.png|128px]]</div></div>
</includeonly>
CC中中 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-cc">[[File:田字图.png|128px]]</div></div>
 
RC右中 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-rc">[[File:田字图.png|128px]]</div></div>
Usage in a page:
<br>
{{FlexContainer|wrap=wrap|gap=20px|
LB左下 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-lb">[[File:田字图.png|128px]]</div></div>
  <div style="flex: 1;">A</div>
BC下中 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-bc">[[File:田字图.png|128px]]</div></div>
  <div style="flex: 1;">B</div>
RB右下 <div class="tooltip-wrapper">[[File:田字图.png|64px]]<div class="tooltip-content-rb">[[File:田字图.png|128px]]</div></div>
}}
</center>

2025年2月23日 (日) 19:14的最新版本

Create a horizontal layout with flexible boxes:

Box 1
Box 2

Items wrap on smaller screens and have a minimum width:

Item 1
Item 2
Item 3

Use flex-direction: column for vertical alignment:

Row 1
Row 2

Center-align items vertically and horizontally:

Centered Content

Create a reusable template (e.g., Template:FlexContainer):


Usage in a page: 模板:FlexContainer