---
title: "CSS中float应用"
author: "FireFlyWithCat"
date: "2012-06-25T21:13:50Z"
tags: []
categories: ["编程语言"]
slug: "css-float"
draft: false
lastmod: "2012-06-25T21:13:50Z"
id: 1567733
url: "https://fireflywithcat.iteye.com/blog/1567733"
---

1、在CSS中float的用法，在Css中float的用法是浮动的意思，就是可以让元素浮动到想要的地方，它的几个属性是：none、right、left、inherit四个属性（其中只有inherit比较特殊，因为inherit不支持IE8一下的任何一个版本）inherit意思是继承父类的float属性。还有很多属性需要设置。
2、与float相辅相生的一个属性是clear：其有五个值是：both、right、left、none、inherit五个，其中inherit的属性与float的inherit的属性相同，他们的意思是：清空两边、右边、左边、无、继承的浮动元素！