删除提交按钮下方无法解释的换行符?
在处理我正在做的一个简单网站的布局时,我遇到了一个非常烦人的问题,我只是找不到原因!我不知道如何删除提交按钮下方的换行符,从而向下扩展它所在的 div。
我已经尽可能地简化了页面,尽管可能仍然存在一些不必要的元素在那里。
任何帮助将不胜感激!
while working on the layout of a simple site I'm doing, I came across a really annoying problem of which I just can't find the cause! I have no idea how to remove the linebreak below my submit button, extending the div which it's in downwards.
I've simplified the page as much as I could, though there may still be some unnecessary elements in there.
Any help would be much appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这就是你所需要的。
好吧,我撒谎了:这就是 Firefox/Chrome 所需要的全部。
你有这样的情况:
在 IE 中,你需要一个现代的文档类型,例如
才能使其脱离 Quirks 模式。
无论如何你应该添加一个文档类型。
That's all you need.
Ok, I lied: That's all you need for Firefox/Chrome.
You have this:
In IE, you need a modern doctype such as
<!DOCTYPE html>
to bring it out of Quirks mode.You should add a doctype anyway.
您的
form
元素的margin-bottom
为1em
,它将其父 div 向下推该量。去掉边距就可以了。
Your
form
element has amargin-bottom
of1em
, which is pushing its parent div downward by that amount.Remove the margin and you should be OK.
只是补充一下:
你确实应该使用 css 重置,有很多好的重置,例如 Eric Meyer 的重置 http://meyerweb.com/eric/tools/css/reset/。
这会处理所有默认的意外边距和填充,这些边距和填充有时会因浏览器而异。
Just add:
You really ought to use a css reset, there are many good ones, such as the 2011 version of Eric Meyer's reset http://meyerweb.com/eric/tools/css/reset/.
This takes care of all the default unintended margins and paddings that sometimes vary from browser to browser.