HTML CSS examples for CSS Layout:Fixed Position
Css vertically centering a fixed positioning div
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #lightbox {<!-- w ww. ja va2s . com--> display:table-cell; vertical-align:middle; position:fixed; width:100%; text-align:center; z-index:601; cursor:pointer; left:0; top:100px; } #image { position:relative; height:100px; border:2px solid Chartreuse; } </style> </head> <body> <div id="lightbox"> <img id="image" src="https://www.java2s.com/style/demo/Firefox.png"> </div> </body> </html>