Bài 12: Position Fixed trong CSS
RUN
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style> body{ height: 2000px; background: blue; } .relative{ margin-top: 200px; position: relative; height: 100px; } .fixed{ height: 30px; line-height: 30px; background: red; color: #fff; position: fixed; width: 100%; } .bottom{ height: 400px; margin-top: 600px; background: yellow; } </style> </head> <body> <div class="relative"> <div class="fixed"> Chào mừng bạn đến với freetuts.net </div> </div> <div class="bottom"> </div> </body> </html>
PHÓNG TO