I have a webpage with a container DIV which contains some other DIV ('acBox' class), each with a small picture.
When the screen is wide (by example 1000 px), it's several 'acBox' per line, that's ok.
But when the screen is narrow and it's only one 'acBox' per line, I wish to center them horizontally.
The way I found is :
@media screen and (max-width: 490px) {
.acBox {
float:none ;
clear:both ;
display:table ;
margin-left:auto ;
margin-right:auto;
}
}
But 'display' is 'table'. For some JavaScript reasons, I wish to keep 'block', so I can keep simple the code to hide and show some 'acBox'. I prefer not testing screen resolution, so I wish can to do :
document.getElementById( some_id ).style.display = "block";
Is it please a way to do that ?