<html> ---- position
position 固定的屬性,是全局的。和DIV層次無關。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div style="background-color: aqua">標記1</div> <div style="background-color: brown ;position: fixed; bottom: 0;right: 0" >標記2</div> </body> </html>
結果如下:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div style="background-color: aqua ;height: 100px"> 標記1 <div style="background-color: brown ;" >標記2</div> </div> </body> </html>

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <div style="background-color: aqua ;height: 100px"> 標記1 <div style="background-color: brown ;position: fixed;right: 0;bottom: 0;" >標記2</div> </div> </body> </html>
浙公網安備 33010602011771號