html之如何让多个并列的div居中显示

<div id="testContainer">
    <div><img src="1.png">div>
    <div><img src="1.png">div>
    <div><img src="1.png">div>
    <div><img src="1.png">div>
    <div><img src="1.png">div>
    <div><img src="1.png">div>
    <div><img src="1.png">div>
    <div><img src="1.png">div>
div>
#CSS:
#testContainer {
    text-align: center;
}
#testContainer > div {
    display: inline-block;
}
#testContainer img {
    width: 200px;
    height: 200px;
}

你可能感兴趣的:(HTML)