search

Home  >  Q&A  >  body text

自己写了一段代码,但是浮动的效果没有,是什么情况?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

<!DOCTYPE html>

<html>

<head>

    <title></title>

    <style type="text/css">

        div{

            width:600px;

            height:300px;

            border:1px solid red;

            float:left;

        }

    </style>

</head>

<body>

    <div></div>

    <div></div>

</body>

</html>

333.png

素颜素颜3050 days ago1334

reply all(3)I'll reply

  • 数据分析师

    数据分析师2017-09-30 22:53:29

    I have written a piece of code, but the floating effect is not there, what is the situation? - PHP Chinese website Q&A - I have written a piece of code, but the floating effect is not there, what is the situation? - PHP Chinese website Q&A

    Take a look around, Study it.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2016-12-19 11:43:24

    可以把"folat:left"属性删除掉,就可以实现图中的效果了,也可以在两个<div>之间加点内容,看起来效果更明显。


    reply
    0
  • 迷茫

    迷茫2016-12-19 11:34:08

    可能是是浏览器的宽度不够,你可以吧浏览器最大化,然后在试一下!

    reply
    0
  • Cancelreply