没有表单的按钮在 Firefox 中看起来很糟糕
我有一个按钮本身与表单无关,但基本上仅用作超链接。它在 Chrome 和 Safari 中看起来不错,但在 Firefox 中,后面有一条丑陋的额外线条。
https://i.sstatic.net/IndYp.png
(上面的淡灰线是故意的,它后面的粗线是我想要摆脱的)
我的 HTML 模板中有以下内容(它是 Django,但这并不重要):
<p class="submitrow"><form><a href="{% url events_create_event %}"><input type="submit" name="delete" value="Create New Event" /></form></p>
摆脱标签不会改变任何东西。
如何让我的按钮在 Firefox 中也看起来正常?
谢谢!
I have a button that's not associated with a form per se, but basically only serves as a hyperlink. It looks fine in Chrome and Safari, but in Firefox, there's an ugly extra line behind it.
https://i.sstatic.net/IndYp.png
(The faint grey line above it is intentional, the thicker line behind it is what I'm trying ot get rid of)
I have the following in my HTML template (it's Django, but that doesn't really matter):
<p class="submitrow"><form><a href="{% url events_create_event %}"><input type="submit" name="delete" value="Create New Event" /></form></p>
Getting rid of the tags doesn't change anything.
How can I make my button look normal in Firefox too?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来您需要在
a
上使用text-decoration: none
。另外,您不能在
中包含
- 这是无效的 HTML。
此外,您缺少
,并且
中不能有
基本上,解决掉无效的 HTML,问题就会自行解决。
It looks like you need
text-decoration: none
on thea
.Also, you can't have an
<input>
inside an<a>
- it's invalid HTML.Additionally, you're missing an
</a>
, and you can't have a<form>
inside a<p>
.Basically, sort out your invalid HTML and problem will sort itself out.