< br />不工作在Firefox [英] <br /> not working in Firefox
问题描述
我正在写一些代码,希望在两个输入之间有一些空格,< br />
在Firefox中不起作用:
I'm writing some code and want to have some space between two inputs and <br />
is not working in Firefox:
<input type="text" id="X_Axis" /><br />
<input type="text" id="Y_Axis" />
不会< br />
,< br />
,< / br>
工作。
PS
推荐答案
使用< br />
添加HTML元素之间的间距是不好的做法。我建议指定CSS填充或边距到您的表单元素。以下信息非常丰富:何时使用< br>换行符对CSS定位?
Using <br/>
to add spacing between HTML elements is bad practice. I suggest assigning CSS padding or margins to your form elements. The following post is very informative: When to use <br> line breaks vs CSS positioning?
工作示例: http:/ /jsfiddle.net/uHKzq/1/
我已经添加了CSS属性 display:block;
这将导致您的第二个表单元素显示在第一个表单元素的下面。然后我在表单元素周围应用了一个边距,在两个表单输入字段之间创建了一个空格。
I have added the CSS property display: block;
which will cause your second form element to display on the line bellow the first. I have then applied a margin around the form element, which creates a space between your two form input fields.
这篇关于< br />不工作在Firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!