{"authorId":1,"title":{"title":{}},"slug":"why-is-there-no-float-center","postDate":1217978537,"expiryDate":null,"enabled":1,"fields":{"2":"<p>When they were writing the specifications for CSS, why didn&rsquo;t they allow things to be <strong>floated center<\/strong>?<\/p>\n<!--more-->\n<p>I was looking through an old site at work this week, that was developed long before me, and I saw someone tried to do this: <strong>float: center<\/strong>. So that got me thinking, why would they include the specification to float left and right, but not center?<\/p>\n\n<p>Imagine the posibilities&hellip;the following are just a couple of simple examples of what could be possible, <strong>they are not meant to be used in a production environment<\/strong>.<\/p>\n<ul>\n<li><a href=\"http:\/\/trevordavis.net\/play\/float-center\/\">Float an Image Between Two Columns<\/a>\n<p>In this example, I just floated the image to the right, and gave it a -100px right margin (half the width of the image). Then I just added an empty div to the right hand column, floated it left, and gave it a height and width.<\/p><\/li>\n<li><a href=\"http:\/\/trevordavis.net\/play\/float-center\/image-align-center\/\">Float an Image in the Middle of One Column<\/a>\n<p>This one is really hacky. I absolutely positioned the image, chose a monospaced font, and then added non-breaking spaces so that the image was no longer covering the text.<\/p><\/li>\n<\/ul>\n\n<p>I think being able to float something in the center could really make pages more interesting. I would be curious to know if there was any specific explanation for why you cannot float to the center.<\/p>","4":{"website":{}}}}