我已经google了一下,但还是无法弄清楚两者之间的确切差异.从jquery-rails上读到我(https://github.com/indirect/jquery-rails)似乎jquery-ujs补充了它,但我不确定为什么/如何.
如果有人可以打破这一点,我将不胜感激.
谢谢.
请考虑以下代码:
<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML</title>
<meta charset="utf-8" />
<style type="text/css">
h1 {
font-size: 2em;
font-family: Verdana;
font-weight: bold;
}
p {
border: 3px solid blue;
margin-top: -50px;
background-color: green;
color: white;
}
</style>
</head>
<body>
<h1>QUESTION</h1>
<p>The header text in the preceding h1 element is behind this
paragraph's text (as expected), but on top of this paragraph's
background and border (not expected).
</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
请参阅此处的示例:http://jsfiddle.net/ZKHc9/
为什么段落的背景和边框不像内容那样呈现在标题的顶部?