MediaWiki我如何得到[折叠]链接不移动位置与文本
MediaWiki How do I get the [Collapse] link to NOT move position with the text?
当您点击[Expand]
时,[Collapse]
链接会出现,但会随着文本的长度向右移动。
我不想让[Collapse]
链接向右移动,我想让它显示put。
我如何让[Collapse]
链接不与文本移动位置?
{| class="mw-collapsible mw-collapsed" style="text-align:left;"<br>
! '''Header'''<br>
|-<br>
|<br>
Line1: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line2: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line3: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line4: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line5: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
|}
要阻止展开/折叠链接移动,可以在表格上设置宽度,例如:
{| class="mw-collapsible mw-collapsed"
! style="width: 50em" | '''Header'''
|-
| Line1: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line2: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line3: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line4: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line5: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
|}
(我删除了额外的<br>
元素和align: left)
不幸的是,由于"展开"answers"折叠"之间的宽度差异,表头仍然会稍微移动位置。如果想要停止这种移动,可以在wiki的全局样式表Mediawiki:Common.css中添加一条语句来指定切换的宽度。检查源代码,开关位于类.mw-collapsible-toggle
的元素中,因此您可以在Mediawiki:Common.css中使用如下语句指定宽度:
.mw-collapsible-toggle { width: 5em; }
您还可以将页眉向左对齐(就像您在原始示例中所做的那样),而不是集中对齐。
girlwithglasses的解决方案是正确的。但是,如果[collapse]链接仍然在移动,那是因为内容(由于间距而放在<pre>
标签之间)迫使表格的宽度超过50em。可以通过显式设置单元格的max-width:
{| class="mw-collapsible mw-collapsed"
! style="width: 50em" | '''Header'''
|-
| style="max-width: 50em" |
Line1: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line2: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line3: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line4: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line5: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
|}
…或者,当然,通过删除前导空格:
{| class="mw-collapsible mw-collapsed"
! style="width: 50em" | '''Header'''
|-
| Line1: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line2: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line3: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line4: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
Line5: A long line of text that is used to test the position of the [Collapse] link in my document.<br>
|}
相关文章:
- 我发现了一些只在移动设备上可见的垃圾邮件链接,我可以'找不到包含此垃圾邮件链接的脚本的位置
- 替换移动设备的链接文本
- 链接don'由于Javascript悬停效果,无法在移动设备上工作
- 移动站点重定向与完整的站点链接
- Angular UI&引导程序:点击链接时折叠移动导航栏
- 强制单击空链接以不移动页面焦点
- 简单的移动重定向/深度链接实施
- 如何在点击链接后从用户取消对话框中获得回调以选择移动应用程序
- 试图在CSS中以顶部标题居中链接,但不会移动
- 从页面上点击的链接中删除数据,然后移动到下一页&在CasperJS中重复
- 当屏幕尺寸较小时,可使用Javascript向移动菜单添加链接.不再有效
- 图片链接在移动设备上不起作用
- 使用Jquery上下链接移动Divs
- 单击链接时加载移动鼠标光标 3-4 秒
- 移动设备上的网站超链接不起作用
- JQuery 移动版:页面链接不可靠
- 由于页面宽度更改,指向锚点的链接移动到错误的位置
- 根据包含的链接移动DOM中的元素
- 将标签链接移动到博客的右侧
- jQuery-当链接移动到导航菜单的最左边时,点击更改链接的css