English 中文(简体)
为什么有浮标的物会使小块的面积消失?
原标题:Why does a float css property resize a div s size?

Given the following style:

#myDiv{
  background:orange;
  width:250px;
}

和以下超文本:

<div id="myDiv">
    <p>
        Vote Pirates!<br />
    </p>
</div>

Whytailly? 如果在我的主风格上添加一个<>float:left 财产,这是否会改变iv的大小?

Edit:重新定位是一个浏览器问题,甚至更糟的是操作系统的具体问题。

最佳回答

This seems like the likely answer: A floated box is taken out of the flow, so it doesn’t affect the block-level boxes around it.

摘自

另外,您还可能正在经历浏览器的具体功能(浏览器?)。 你们是否使用国际电子计算方法6?

问题回答

你们目前的例子的规模已经变化。

然而,相对单位的要素将发生变化。 <代码>float 财产从目前情况看便可穿透元素,造成高度/宽度可能有所不同。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签