HTML print with absolute postitions

前端 未结 6 1303
野的像风
野的像风 2020-12-30 00:51

Is it possible to print a HTML page with truly absolute positioned elements to paper? It seems all browsers are doing a big mess here. It is easy to define a body by absolut

6条回答
  •  自闭症患者
    2020-12-30 01:32

    Make your container to have relative position. That's the only way to keep absolute positioned elements in the same place at every screen and paper. so if your main div (the div where all of your content is located) add following to your css:

    #maindivname{position:relative;}
    

    Should do the trick.

提交回复
热议问题