我没有Java经验,我纯粹关注FB'演练'但没有运气。基本上我想要添加这个按钮,稍微放在欢迎的图像下并对齐。如果我能看到这个糟糕的东西会很有帮助......
.container {
padding-top: 0px;
padding-left: 0px;
padding-right: 10px;
font-family: arial;
z-index: 2;
}
a {
float: right;
text-decoration: none;
padding-left: 10px;
color: #003399;
}
li {
display: inline;
}
.navbar {
float: right;
padding-top: 75px;
padding-bottom: 45px;
padding-right: 0px;
z-index: 2;
}
#intro img {
position: absolute;
display: block;
margin: auto;
max-width: 100%;
height: auto;
z-index: 1;
}
.fb-like {
position: absolute;
display: block;
z-index: 3;
}

<!DOCTYPE html>
<html>
<head>
<title>St George's League - Home</title>
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>
<div id="fb-root"></div>
<script language="JavaScript">
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = "//connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div style="min-width: 800px; min-height: 600px; margin: 0 auto">
<div class="container">
<ul>
<div class="nav">
<li>
<img src="images/sgl-logo.jpg" height="145px" alt="SGLLogo" />
</li>
<div class="navbar">
<li class="contact"><a href="contact.html">CONTACT</a>
</li>
<li class="about"><a href="about.html">ABOUT</a>
<li class="leagues"><a href="leagues.html">LEAGUES</a>
</li>
<strong><li class="home"><a href="index.html">HOME</a></li></strong>
</div>
<!--Nav End-->
</div>
<!--Navbar End-->
</div>
<!--Container End-->
<div id="intro">
<img src="images/intro.jpg" />
</div>
<!--Intro End-->
</div>
<!--Style End-->
<div class="fb-like" data-href="https://www.facebook.com/StGeorgesLeagues" data-width="80" data-layout="button_count" data-action="like" data-show-faces="false" data-share="true">
</div>
<!--FB Like End-->
</body>
</html>
&#13;
答案 0 :(得分:0)
我无法找到初始脚本或调用它来显示按钮的任何问题。使用Facebook,您可以拥有个人页面,也可以在其他页面上成为管理员。除非您登录Facebook,否则在您的站点中嵌入此按钮将不会显示。如果没有登录Facebook,您将获得一个可点击登录的小链接。一旦您登录Facebook,登录链接将消失,并弹出类似按钮。为了彻底,我将你的代码粘贴到我的网站上,你的喜欢按钮显示得很好......