3,443
个编辑
无编辑摘要 |
|||
(未显示5个用户的14个中间版本) | |||
第1行: | 第1行: | ||
该模板为所有页面提示框的元模板。 | 该模板为所有页面提示框的元模板 。该模板包含了原始的提示框样式,并可以在其基础上完全自定义。该模板同时也内置了部分固定样式模板以便快速使用及统一格式 。 | ||
{| class="wikitable" style="text-align:center;" | {| class="wikitable" style="text-align:center;" | ||
|- | |- | ||
! 参数 !! 说明 !! 填写内容 !! 必填/选填 | ! 参数 !! 说明 !! 填写内容 !! 必填/选填 | ||
|- | |- | ||
| content | | content || 提示框中内容 || 文字或 html 标签 || '''必填''' | ||
|- | |- | ||
| style || 提示框样式 || css || 选填 | | style || 提示框样式 || css || 选填 | ||
|- | |||
| template || 样式模板 || 模板名 || 选填 | |||
|} | |} | ||
以下为使用例。 | 以下为使用例。 | ||
第16行: | 第18行: | ||
| {{ tipbox | content = 我是内容 }} | | {{ tipbox | content = 我是内容 }} | ||
|- | |- | ||
| <code><nowiki>{{ tipbox | content = 啊这 | style = width: 100px;}}</nowiki></code> | | <code><nowiki>{{ tipbox | content = 啊这 | style = width: 100px; color: Orange }}</nowiki></code> | ||
| {{ tipbox | content = 啊这 | style = width: 100px;}} | | {{ tipbox | content = 啊这 | style = width: 100px; color: Orange }} | ||
|- | |||
| <code><nowiki>{{ tipbox | content = 固定模板 | style = width: 200px; | template = blue }}</nowiki></code> | |||
| {{ tipbox | content = 固定模板 | style = width: 200px; | template = blue }} | |||
|} | |||
目前内置的固定样式模板如下。 | |||
{| class="wikitable" | |||
|- | |||
! 类型 !! 效果及模板名 | |||
|- | |||
| 颜色 | |||
| {{ tipbox | content = blue | style = width: auto; float: left; margin: 4px; | template = blue }} | |||
{{ tipbox | content = green | style = width: auto; float: left; margin: 4px; | template = green }} | |||
{{ tipbox | content = orange | style = width: auto; float: left; margin: 4px; | template = orange }} | |||
{{ 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 = 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样式如下。 | |||
{| class="wikitable" | |||
|- | |||
! 样式名 !! 代码 !! 实际效果 !! 说明 | |||
|- | |||
| 圆角 | |||
| <code>border-radius: 8px;</code> | |||
| {{ tipbox | content = 圆角 | style = width: 160px; margin: 4px; border-radius: 8px;}} | |||
| 修改数字可调整圆角大小 | |||
|- | |||
| 宽度 | |||
| <code>width: 320px;</code> | |||
| {{ tipbox | content = 宽度 | style = width: 320px; margin: 4px; }} | |||
| 修改数字可调整宽度,也可使用80%百分比以指定相对父元素的宽度占比,或使用auto以自适应内容宽度 | |||
|- | |||
| 背景颜色 | |||
| <code>background-color: #66ccff;</code> | |||
| {{ tipbox | content = 背景颜色 | style = width: 160px; margin: 4px; background-color: #66ccff; }} | |||
| 使用颜色名称,16进制颜色值,也可使用类似 rgba(0,0,0,0.1) 以调整背景透明度 | |||
|- | |||
| 边框样式 | |||
| <code>border: 3px solid #ec870e;</code> | |||
| {{ tipbox | content = 边框样式 | style = width: 160px; margin: 4px; border: 3px solid #ec870e; }} | |||
| 三个参数分别为边框宽度,边框线形和边框颜色 | |||
|} | |} | ||
更多样式请参考 [https://www.w3school.com.cn/cssref/index.asp css样式手册] | |||
<noinclude>[[分类:模板说明]]</noinclude> | <noinclude>[[分类:模板说明]]</noinclude> |