CSS: position:fixed inside of position: fixed
问题 Okay, I've noticed something, but couldn't find it in the CSS spec. Styling an element with position: fixed will position it absolutely, with respect to the browser viewport. What happens if you place a fixed-position element inside another? Example CSS along the lines of: .fixed { position: fixed; width: 100px; height: 100px; background: red; } #parent { right 100px; padding: 40px; } .fixed .fixed { background: blue; } And HTML: <div id="parent" class="fixed"> <div class="fixed"> </div> <