Saturday 22nd of July 2017 04:31:10 AM

center a FIXED BOX

This BOX has a fixed width.
It is centered and adjusts to the browser window.

Inherited

yes

Applies to

all elements

The height adjusts to the content.
more nice and free css templates

body {
background-color: #e1ddd9;
font-size: 12px;
color:#564b47;
padding:20px;
margin:0px;
text-align: center;
}
#inhalt {
text-align: left;
vertical-align: middle;
margin: 0px auto;
padding: 0px;
width: 550px;
background-color: #ffffff;
border: 1px dashed #564b47;
}

percentages for margin andpadding may be the best way to set styles thatwill hold up in more than one media; for example, documents that willlook good on a monitor as well as a printout.

It's also possible to mix percentages with length values. Thus,to set H1 elements to have top and bottom marginsof one-half em and side margins that are 10% of the width of thebrowser window, you can declare the following, shown in Figure 7-12: