Bài 15: Kỹ thuật ClearFix trong CSS
RUN
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style> .group1{ border: solid 1px red; } .left{ border: solid 1px blue; width: 200px; height: 200px; float: left; } .right{ border: solid 1px blue; width: 200px; height: 200px; float: right; } </style> </head> <body> <div class="group1"> <div class="left"> float:left, không ảnh hưởng tới chiều cao thẻ cha </div> <div class="right"> float:right, không ảnh hưởng tới chiều cao thẻ cha </div> <div> Nội dung không có float. CHiều cao của thẻ cha phụ thuộc mỗi thẻ div này thôi. </div> </div> </body> </html>
PHÓNG TO