Ticket #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: | ||
| Blocking: | Blocked by: |
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
Change History
Changed 3 years ago by abgne.tw
-
attachment
20100418border.html
added
comment:2 Changed 3 years ago by rwaldron
- Owner set to abgne.tw
- Priority set to undecided
- Status changed from new to pending
Please provide a reduced jsFiddle test case, thanks!
Additionally, test against the jQuery 0 GIT version to ensure the issue still exists.
comment:5 Changed 3 years ago by dmethvin
- Keywords needsreview removed
- Status changed from new to closed
- Resolution set to worksforme
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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

sample