「Template:Tipbox/doc」:修訂間差異

出自Arcaea中文维基
無編輯摘要
→‎top:​clean up, replaced: <noinclude></noinclude> → <noinclude>分类:模板说明</noinclude>
 
(未顯示由 5 位使用者於中間所作的 5 次修訂)
行 35: 行 35:
{{ tipbox | content = yellow | style = width: auto; float: left; margin: 4px; | template = yellow }}
{{ tipbox | content = yellow | style = width: auto; float: left; margin: 4px; | template = yellow }}
{{ tipbox | content = red | style = width: auto; float: left; margin: 4px; | template = red }}
{{ tipbox | content = red | style = width: auto; float: left; margin: 4px; | template = red }}
{{ tipbox | content = purple | style = width: auto; float: left; margin: 4px; | template = purple }}
{{ tipbox | content = indigo | style = width: auto; float: left; margin: 4px; | template = indigo }}
|-
| 带状
| {{ tipbox | content = band | style = width: auto; float: left; margin: 4px; | template = band }}
{{ tipbox | content = band-blue | style = width: auto; float: left; margin: 4px; | template = band-blue }}
{{ tipbox | content = band-green | style = width: auto; float: left; margin: 4px; | template = band-green }}
{{ tipbox | content = band-orange | style = width: auto; float: left; margin: 4px; | template = band-orange }}
{{ tipbox | content = band-yellow | style = width: auto; float: left; margin: 4px; | template = band-yellow }}
{{ tipbox | content = band-red | style = width: auto; float: left; margin: 4px; | template = band-red }}
{{ tipbox | content = band-purple | style = width: auto; float: left; margin: 4px; | template = band-purple }}
{{ tipbox | content = band-indigo | style = width: auto; float: left; margin: 4px; | template = band-indigo }}
|}
|}
 常用自定义css样式如下。
 常用自定义css样式如下。
行 48: 行 60:
| 宽度
| 宽度
| <code>width: 320px;</code> 
| <code>width: 320px;</code> 
| {{ tipbox | content =  背景颜色 | style = width: 320px; margin: 4px; }}
| {{ tipbox | content =  宽度 | style = width: 320px; margin: 4px; }}
| 修改数字可调整宽度,也可使用80%百分比以指定相对父元素的宽度占比,或使用auto以自适应内容宽度
| 修改数字可调整宽度,也可使用80%百分比以指定相对父元素的宽度占比,或使用auto以自适应内容宽度
|-
|-
| 背景颜色
| 背景颜色
| <code>background-color: #66ccff;</code> 
| <code>background-color: #66ccff;</code> 
| {{ tipbox | content =  宽度 | style = width: 160px; margin: 4px; background-color: #66ccff; }}
| {{ tipbox | content =  背景颜色 | style = width: 160px; margin: 4px; background-color: #66ccff; }}
| 使用颜色名称,16进制颜色值,也可使用类似 rgba(0,0,0,0.1) 以调整背景透明度
| 使用颜色名称,16进制颜色值,也可使用类似 rgba(0,0,0,0.1) 以调整背景透明度
|-
|-
行 61: 行 73:
| 三个参数分别为边框宽度,边框线形和边框颜色
| 三个参数分别为边框宽度,边框线形和边框颜色
|}
|}
 更多样式请参考[https://www.w3school.com.cn/cssref/index.asp css样式手册]
 更多样式请参考 [https://www.w3school.com.cn/cssref/index.asp css样式手册]
<noinclude>[[分类:模板说明]]</noinclude>
<noinclude>[[分类:模板说明]]</noinclude>

於 2020年8月28日 (五) 11:37 的最新修訂

該模板為所有頁面提示框的元模板。該模板包含了原始的提示框樣式,並可以在其基礎上完全自定義。該模板同時也內置了部分固定樣式模板以便快速使用及統一格式。

參數 說明 填寫內容 必填/選填
content 提示框中內容 文字或 html 標籤 必填
style 提示框樣式 css 選填
template 樣式模板 模板名 選填

以下為使用例。

代碼 實際效果
{{ tipbox | content = 我是内容 }}
我是內容
{{ tipbox | content = 啊这 | style = width: 100px; color: Orange }}
啊這
{{ tipbox | content = 固定模板 | style = width: 200px; | template = blue }}
固定模板

目前內置的固定樣式模板如下。

類型 效果及模板名
顏色
blue
green
orange
yellow
red
purple
indigo
帶狀
band
band-blue
band-green
band-orange
band-yellow
band-red
band-purple
band-indigo

常用自定義css樣式如下。

樣式名 代碼 實際效果 說明
圓角 border-radius: 8px;
圓角
修改數字可調整圓角大小
寬度 width: 320px;
寬度
修改數字可調整寬度,也可使用80%百分比以指定相對父元素的寬度占比,或使用auto以自適應內容寬度
背景顏色 background-color: #66ccff;
背景顏色
使用顏色名稱,16進位顏色值,也可使用類似 rgba(0,0,0,0.1) 以調整背景透明度
邊框樣式 border: 3px solid #ec870e;
邊框樣式
三個參數分別為邊框寬度,邊框線形和邊框顏色

更多樣式請參考 css樣式手冊