Return to Snippet

Revision: 70892
at August 31, 2016 04:32 by heathbo


Initial Code
/* The Magic Float Center Code */
.float_center {
  float: right;

  position: relative;
  left: -50%; /* or right 50% */
  text-align: left;
}
.float_center > .child {
  position: relative;
  left: 50%;
}

Initial URL

                                

Initial Description
.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.

Initial Title
CSS: Float Center

Initial Tags

                                

Initial Language
CSS