简体   繁体   English

换行符是否适用于所有浏览器中的表单?

[英]Does a line break apply after a form in all browsers?

Nothing really to add to the title... 没什么可添加的标题...

I tried it in Chrome and FF, but not in IE. 我在Chrome和FF中尝试过,但在IE中没有尝试过。 Does line break apply after a form in ALL BROWSERS? 换行符是否适用于所有浏览器中的表格?

You will always have a "line break" since <form> is a block element. 因为<form>是一个块元素,所以您始终会有一个“换行符”。

You can get rid of the line break, and the blank line using CSS : 您可以使用CSS删除换行符和空白行:

To prevent just the "empty line", you could use 为了防止出现“空行”,您可以使用

form { 
  margin: 0px;
}

To prevent both the "empty line" and the line break, you could use 为了防止“空行”和换行,您可以使用

form {
  display: inline;
}

No, but I know certain version of IE do it. 不,但是我知道一定版本的IE可以做到。

My fix 我的解决办法

<style type="text/css">
form {
   display: inline;
   margin: 0px;
}
</style>

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

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