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; padding: 1px; } .group1:after{ clear: both; content: "."; display: block; } .left{ border: solid 1px blue; width: 200px; height: 100px; float: left; background: tomato; } .right{ border: solid 1px blue; width: 200px; height: 100px; float: right; background: pink; } .group2{ height: 100px; background: yellow; } </style> </head> <body> <div class="group1"> <div class="left"> Nội dung bên trái </div> <div class="right"> Nội dung bên phải </div> </div> <div class="group2"> Nội dung bên dưới </div> </body> </html>
PHÓNG TO