> For the complete documentation index, see [llms.txt](https://tpout.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tpout.gitbook.io/workspace/web/css/bu-ju/float.md).

# float

应用 [`float`](https://developer.mozilla.org/zh-CN/docs/Web/CSS/float) 值，诸如 `left` 能够让块级元素互相并排成一行，而不是一个堆叠在另一个上面 &#x20;

```css
div:nth-of-type(1) {
  width: 48%;
  float: left;
}

div:nth-of-type(2) {
  width: 48%;
  float: right;
}
```
