编辑下面的代码:【加编码】
<html> <head> <style> h2.pos_top { position:relative; top:-50px; } </style> </head> <body> <h2>This is a heading with no position</h2> <h2 class="pos_top">This heading is moved upwards according to its normal position</h2> <p><b>Note:</b> Even if the content of the relatively positioned element is moved, the reserved space for the element is still preserved in the normal flow.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂