How to make a fixed div element with css ?
问题 I need to create div element that would always be at the top right corner above all other elements Here is what I tried <div id="prompt" style=" height:50px; width:50px; background: #F00; position: fixed; top: 150px; margin-left: 948px; z-index: 9999">Test</div> I need it to work with IE8 , but it is not working. 回答1: You need to set left: 0; or use right without margin-left . 回答2: For positioning in the top-right corner: <div id="prompt" style="height:50px; width:50px; background: #F00;