Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
Created September 29, 2016 17:43
Show Gist options
  • Select an option

  • Save leepettijohn/7e06a2fe21307f73e0d3f379f2685077 to your computer and use it in GitHub Desktop.

Select an option

Save leepettijohn/7e06a2fe21307f73e0d3f379f2685077 to your computer and use it in GitHub Desktop.
Center div between two different sized divs
<style>
div{height:100px}
.left{float:left; width:100px;}
.right{float:right; width:300px;}
.middle-wrap{overflow:hidden}
.middle{margin:0 auto; width:50px}
</style>
<div class="left"></div>
<div class="right"></div>
<div class="middle-wrap">
<div class="middle"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment