position element fixed beside image

♀尐吖头ヾ 提交于 2019-12-13 08:22:31

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!