---
title: "float样式对DIV的影响"
author: "modiliany"
date: "2012-10-21T17:14:41Z"
tags: []
categories: ["Web前端"]
slug: "float-div"
draft: false
lastmod: "2012-10-21T17:17:55Z"
id: 1702576
url: "https://modiliany.iteye.com/blog/1702576"
---

<span style="color:blue">Float样式对DIV的影响</span>


    示例: 下图中的"在首页中预览"按钮本应该是放在行业目录内容的DIV的正下方，但是因为行业目录内容的div的样式中带有float:left属性，做这个div被悬浮起来了，导致按钮的height属性与行业目录的height属性相同：
.sideproNavBox {width: 245px; height: 243px; float:left; margin-top: 10px;}




因图片多不方便上传，详细内容请下载附件。