Wednesday 10th of March 2010 07:03:45 PM
center a FIXED BOX
This BOX has a fixed width.
It is centered and adjusts to the browser window.
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;
}
<IMG> tag:
| Here's an in-line greyscale image with default settings
and unpredicable placement on the page.
<IMG SRC="ugly2.gif">
If you resize the browser window the image jumps around as
the lines re-wrap. |
Here's an in-line greyscale image with default settingsdone in CSS: the units that affect the color used or thedistance set for a whole host of properties.Without units, it wouldn't be possible to declare that aparagraph should be purple, or that an image should have ten pixelsof blank space around it, or that a heading should be a certain size.By understanding the concepts put forth here, you'll be able tolearn and use the rest of CSS much more quickly. However, that's the good news. The bad news is that thischapter will contain a good many caveats, warnings, and discussionsbackground repeats from the center, the grid is centered within theviewport, resulting in consistent "clipping" along theedges. The variations may seem subtle, but the odds are thatyou'll have reason to use both approaches at some point in yourdesign career. In case you're wondering, there is no way to control the repeatany more than we've already discussed. There is norepeat-left, for example, although it couldcertainly be added in some future version of CSS. For now, you get |