我已向博客中的共享栏添加了一个代码,它可以正常工作,但是当窗口未最大化时,我希望它不可见。我需要更改以完成此操作吗?

<style>
#pageshare {position:fixed; bottom:15%; right:10px; float:left; border: 1px solid #999999; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background-color:#e5e5e5;padding:0 0 2px 0;z-index:10;}

#pageshare .sbutton {float:left;clear:both;margin:5px 5px 0 5px;}
.fb_share_count_top {width:48px !important;}
.fb_share_count_top, .fb_share_count_inner {-moz-border-radius:3px;-webkit-border-radius:3px;}
.FBConnectButton_Small, .FBConnectButton_RTL_Small {width:49px !important; -moz-border-radius:3px;-webkit-border-radius:3px;}
.FBConnectButton_Small .FBConnectButton_Text {padding:2px 2px 3px !important;-moz-border-radius:3px;-webkit-border-radius:3px;font-size:8px;}
</style>
<br/><div id='pageshare' title="Share This With Your Friends">
<div class='sbutton' id='gb'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like layout="box_count" show_faces="false" font=""></fb:like></div>
<br/><div class='sbutton' id='rt'><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" >Tweet</a><script src='http://platform.twitter.com/widgets.js' type="text/javascript"></script></div>
<br/><div class='sbutton' id='gplusone'><script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><g:plusone size="tall"></g:plusone></div>

最佳答案

您可以通过媒体查询来做到这一点吗?

@media screen and (max-width: 768px) {
#pageshare{
    display: none;
}


}

关于css - 未最大化时隐藏侧边栏 float 共享栏,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14889506/

10-14 13:01