问题
Hey guys it a bit hard for me to explain, but I'll try as best I can. I have a sharing div on my side
<div class="share">
And I want to fixe it in the center of the screen top:50% on left of the image. I tried many css thing but no success.
here's the webpage http://giantgag.com/?p=10272
It doesn't work with all screen resolution. The sharing buttons goes over the image
回答1:
Actually the css is working fine. top:50%
keeps the top point of div at 50% distance from top which is what you are seeing in your site.
For correct solution irrespective of any screen size, use javascript to give the position to div at onload.
来源:https://stackoverflow.com/questions/21516030/position-element-fixed-beside-image