I have a web page with a header area in the middle. Elements are then part of the header. Can someone explain what overflow: hidden; does here. I don’t understand why I need it or what it does.
#hdr_mdl {
margin: 0 auto;
overflow: hidden;
width: 980px;
z-index: 10;
height: 50px;
}
overflow:hiddenprevents scrollbars from showing up, even when they’re necessary.Explanation of your CSS:
margin: 0 autohorizontally aligns the element at the centeroverflow:hiddenprevents scrollbars from appearingwidth:980pxsets the width of the element to be980px.z-index:10causes the element to stay on top of elements without a definedz-index, *or- elements with az-indexbelow 10, or elements with az-indexof 10, but defined in before the current elementheigh:50px– a height of50px.