关于css中浮动float的最好理解

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<p style="border:3px solid silver; width:300px;">
    <p id="container" style="background-color: blue;">
        <p style="float:left; background-color: green;">above</p>
        <p id="DIV" style="margin:30px 0; background-color:gold;">content</p>
        <p style="float:right; background-color: green;">below</p>
    </p>
</p>
<hr>
<hr>
<p style="border:3px solid silver; width:300px;">
    <p id="container" style="background-color: blue;">
        <p style="position:absolute; background-color: green;">above</p>
        <p id="DIV" style="margin:30px 0; background-color:gold;">content</p>
        <p style="position:absolute; background-color: green;">below</p>
    </p>
</p>
<hr>
<hr>
<p style="border:3px solid silver; width:300px;">
    <p id="DIV1" style="margin-bottom:50px; background-color:gold;">above</p>
    <p id="Float" style="float:left; background-color: green; width:100%;">Float</p>
    <p id="DIV2" style="margin-top:50px; background-color:gold;">below</p>
</p>

</body>

</html>

效果如下:

更多关于css中浮动float的最好理解相关文章请关注PHP中文网!

关于css中浮动float的最好理解

相关文章:

你感兴趣的文章:

标签云: