Opened 13 years ago
Closed 12 years ago
#6456 closed bug (worksforme)
Div border will affect the boxModel
Reported by: | abgne.tw | Owned by: | abgne.tw |
---|---|---|---|
Priority: | undecided | Milestone: | 1.4.2 |
Component: | core | Version: | 1.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When using css to set div's border will affect the judgments boxModel. But not this problem in 1.2.6. Here is a simple example:
<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="zh-tw"> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script> <style type="text/css">
div {
height: 2000px; border: solid 1px red; /* If you remove the border settings will be moved to the right place */
}
</style> <script type="text/javascript">
$(function(){
$("a").click(function(){
move to h5's location but.... $("html, body").scrollTop($("h5").offset().top);
/* If you remove the border settings will be moved to the right place */
return false;
});
});
</script> </head>
<body>
<h4>H4</h4> <h5>H5</h5> <div></div> <a href="#">Click</a>
</body> </html>
Attachments (1)
Change History (6)
Changed 13 years ago by
Attachment: | 20100418border.html added |
---|
comment:2 Changed 12 years ago by
Owner: | set to abgne.tw |
---|---|
Priority: | → undecided |
Status: | new → pending |
Please provide a reduced jsFiddle test case, thanks!
Additionally, test against the jQuery 0 GIT version to ensure the issue still exists.
comment:3 Changed 12 years ago by
Keywords: | needsreview added |
---|
comment:5 Changed 12 years ago by
Keywords: | needsreview removed |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
http://jsfiddle.net/dmethvin/kfE9e/1/ This one works fine in IE8. Your example is using a non-specific "div" selector and is probably catching some other element injected into the document.
sample