float问题,这是不是错的_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:40:47
Original
941 people have browsed it

结果应该是a把b遮盖了。c在下面。

回复讨论(解决方案)

结果应该是a把b遮盖了。c在下面。
你要什么结果?正常情况不会遮住,因为z-index同层,默认position:static;而不是position: absolute

按书本的意思





a

b

c



结果是:

我也是新手,感觉是B块在A 的下面了,如果想要让B块跟随在A的后面应该是给B加一个float:left;

<html> <head> <style type="text/css"> #a,#b,#c {  width:100px;  height:100px;  background:red; } #b {  float:left; } #b{background:yellow;} #c{background:blue;} </style> </head> <body> <div id="a">a</div> <div id="b">b</div> <div id="c">c</div> </body> </html>
Copy after login

你试试看

我也做了下测试
如果b不浮动的话
就会被a所覆盖
书本不完全是对的

可能书太老了。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template