overflow可以使浮动元素回归文档流,但是浮动元素却仍然具有浮动的属性
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>float与overflow</title> <style> body{ margin: 0px; padding:0px; } div{ width:150px; border:1px solid black; overflow: hidden; } div div{ border:1px solid red; background-color:#fdedd2; float:right; width:50px; height:50px; } p{ margin: 0px; padding: 0px; border: 1px solid red; width: 50px; height: 50px; text-align: center; } </style> </head> <body> <div> <p>p</p> <div>1</div> <div>2</div> </div> </body> </html>