If it's within a fixed-width container add some CSS:
#dynamicDiv {
width: 400px;
margin: 0 auto;
}
If it's not, or the contents changes, you could use a min-width/max-width and the same technique with margins above. If you need to support IE6, then you may need to set an explicit width for this browser using conditional comments or a separate stylesheet or filter rule.
#dynamicDiv {
max-width: 400px;
margin: 0 auto;
}
/* For IE6 (using CSS filter) */
* html #dynamicDiv {
width: 400px;
margin: 0 auto;
}
#dynamicDiv {
width: 400px;
margin: 0 auto;
}
If it's not, or the contents changes, you could use a min-width/max-width and the same technique with margins above. If you need to support IE6, then you may need to set an explicit width for this browser using conditional comments or a separate stylesheet or filter rule.
#dynamicDiv {
max-width: 400px;
margin: 0 auto;
}
/* For IE6 (using CSS filter) */
* html #dynamicDiv {
width: 400px;
margin: 0 auto;
}