I have a div called "thumbs" and a javascript function populating it with images
function fillThumbs(){
for (i=0; i<images.length; i++){
var imageX = document.createElement("img");
imageX.src = images[i];
document.getElementById("thumbs").appendChild(imageX);
}
}
then my css code
#thumbs{
margin: 0 auto;
}
#thumbs img{
width: 220px;
margin: 0 10 10 0;
}
Problem: thumbs div is not centered, nor the #thumbs img are correctly spaced out. Looks like the margin property is ignored, while the width of the images is correctly passed.


#thumbs { text-align: center; }should work