stevenmw
11-10-2012, 10:25 AM
I'm working on a silly little project, and in this project I have a div with a background image that repeats horizontally. I do not have any paddings or margins specified, but I do have borders specified. However, I am using box sizing so the borders should be mathed in. Here is my CSS. Can anyone see why 6 pixels might be added to the height of #head_nav_wrap The DIV is supposed to be 39px in height, but it always ends up 45px. This has got to be something stupid.
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
border: 0;
margin: 0;
padding: 0;
vertical-align: baseline;
}
div
{
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */
}
body {
line-height: 1;
background: #FFFFFF;
}
h1, h2, h3, h4, h5, h6 {
clear: both;
font-weight: normal;
}
ol, ul {
list-style: none;
}
/* head */
#head_main_contain {
min-width: 100%;
background: #000000;
border-top: #333333 1px solid;
}
#head_nav_wrap {
background-image:url('images/nav_back.png');
background-repeat:repeat-x;
height: 39px;
min-width: 100%;
border-top: #FFFFFF 1px solid;
border-bottom: #FFFFFF 1px solid;
}
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
border: 0;
margin: 0;
padding: 0;
vertical-align: baseline;
}
div
{
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */
}
body {
line-height: 1;
background: #FFFFFF;
}
h1, h2, h3, h4, h5, h6 {
clear: both;
font-weight: normal;
}
ol, ul {
list-style: none;
}
/* head */
#head_main_contain {
min-width: 100%;
background: #000000;
border-top: #333333 1px solid;
}
#head_nav_wrap {
background-image:url('images/nav_back.png');
background-repeat:repeat-x;
height: 39px;
min-width: 100%;
border-top: #FFFFFF 1px solid;
border-bottom: #FFFFFF 1px solid;
}