CSS: Float Center


/ Published in: CSS
Save to your folder(s)

.float_center is applied to the parent of the object you want to float center.
.float_center > .child is applied to the object you want to float center.


Copy this code and paste it in your HTML
  1. /* The Magic Float Center Code */
  2. .float_center {
  3. float: right;
  4.  
  5. position: relative;
  6. left: -50%; /* or right 50% */
  7. text-align: left;
  8. }
  9. .float_center > .child {
  10. position: relative;
  11. left: 50%;
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.