例如我设计了一个边框样式的div,并且我设计了另一个div作为中心,我如何将它设置为较大div的中心?如何用CSS设置其他div的div中心?
.Profile_Photo_Border {
\t border: 3px solid #052d31;
\t height: 90px;
\t width: 90px;
\t border-radius: 3px;
}
.Profile_Photo {
\t background-color:#005e67;
\t height: 80px;
\t width: 80px;
\t border-radius: 3px;
\t alignment-adjust:middle;
\t text-align:center;
}
\t
<div class="Profile_Photo_Border">
<div class="Profile_Photo"></div>
</div>
谢谢你@Nikhil Batra它很有用,再次感谢 – MojtabaSh
GLad帮助你@MojtabaSh :) –
你应该注意到,这是使用flexbox和不兼容Internet Explorer 8或9,可能不是10. [(source )](http://caniuse.com/#feat=flexbox)如果你需要支持这些浏览器,它将不起作用。使用5px的 – GregL