Sale is live! Enjoy 70% Off! Use Credit/Debit Cards in India and PayPal outside of India for better experience!

Center div inside another div horizontally

You need to use margin: 0 auto; for inner div. It will automatically center align inner div according to the width of outer div.

Source Code:

	.outer-div {
		background-color: rgba(0, 0, 0, 0.5);
		padding: 50px 0;
		width: 100%;
	.inner-div {
		background-color: #fff;
		width: 200px;
		height: 300px;
		margin: 0 auto;

<div class="outer-div">
	<div class="inner-div"></div>

Free - Download it right now!


Include all files

Demo Download

Reviews and Comments