固定定位制作广告位
实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <link rel="stylesheet" href="static/css/style05.css"> <title>固定定位实现广告位</title> </head> <body> <h1>广告位制作</h1> <div class="box1"> <button onclick="this.parentNode.style.display = 'none' ">戳我</button> <h2>测试广告位</h2> <h1>大写字特别大</h1> </div> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例
实例
body { background-color: bisque; height: 2000px; } .box1 { width: 200px; height: 200px; background-color: blue; position: fixed; left:0; bottom: 0; } .box1 button { float: right; margin-right: 30px; }
运行实例 »
点击 "运行实例" 按钮查看在线实例