width, max-width and max-height, overflow Property in CSS Layout
CSS Layout - width , max-width, max-height, margin:auto, Overflow width, max-width and margin: auto; A block-level element always takes up the full width available. By s etting the width of a block-level element to some value will restrict it from stretching out to the edges of its container. Then, by setting the margins to auto, will align the element horizontally within its container. The element will only take up the width specified, and the remaining space will split equally between the left and right margins: div.ex1 { width : 500px ; margin : auto ; border : 3px solid #73AD21 ; } This <div> element with ex1 class has a max-width of 500px, and margin set to auto. Note: The problem with the < div > above occurs when the browser window is smaller than the width of the element. The browser then adds a horizontal scrollbar to the page. Using max-width ins...