简体   繁体   English

希望在表单标记内的锚链接和元素位于同一行

[英]Want to have anchor link and elements within form tag in the same line

I have the following code and I need to have everything in the same line. 我有以下代码,我需要在同一行中包含所有内容。

<a href="link.com">link</a>
<form method="post">
<input name="submit2" type="submit" class="icon2" value=" " style="display:inline"/>
<input name="submit" type="submit" class="icon3" value=" " style="display:inline" />
</form>

How can I put the link and both buttons in the same line? 如何将链接和两个按钮放在同一行? Are there any CSS attributes that would do this? 是否有任何CSS属性可以做到这一点?

display: inline将,您只需要将其应用到表单。

Try this: 尝试这个:

<form method="post">
<a href="link.com">link</a>
<input name="submit2" type="submit" class="icon2" value=" " style="display:inline"/>
<input name="submit" type="submit" class="icon3" value=" " style="display:inline" />
</form>

EDIT: I think you can also remove the display:inline 编辑:我想你也可以删除display:inline

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM