【发布时间】:2011-03-15 13:39:54
【问题描述】:
我在 Firefox 中偶然发现了一个奇怪的行为。我有一个动态创建的文本,我在其中插入了一个包含链接的表单元素,以便能够通过 post 方法传递参数。理想情况下,它应该与文本一起流动并且看起来像一个普通的锚。 然而,虽然它在 IE 中正常显示,但 Firefox 会在表单之前终止该段落,这会插入一个不需要的换行符。 有谁知道为什么会发生这种情况并有解决方法/替代解决方案?
在 IE 中的结果(ok):
<p class="article" >This is my paragraph and here goes my
<form style="display: inline" name="link_form" action="link.html" method="post">
<input type="hidden" name="lnk_id" value="1" /><a class="link" href="#" onclick="link_form.submit()">link</a></form>**</p>**
Firefox 中的结果 (ko):
<p class="article" >This is my paragraph and here goes my**</p>**
<form style="display: inline" name="link_form" action="link.html" method="post">
<input type="hidden" name="lnk_id" value="1" /><a class="link" href="#" onclick="link_form.submit()">link</a></form>
提前致谢
【问题讨论】:
标签: html firefox forms tags paragraph