- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将我的 facebook 像按钮一样居中。它位于根据单击的菜单项显示/隐藏的 div 中。当我单击显示该 div(并隐藏其他)的 li(新闻和更新)时,单击时我的整个页面都会移动。奇怪的是,当我在 chrome 中“检查元素”时,它并没有移动。您应该能够从窗口复制和粘贴代码并查看 html(不会加载顶部横幅)。
有明显的 css 错误吗?提前致谢
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Chef's Classic - Knock OUT 'Bout</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<style type="text/css">
div {
display: block;
}
.tabs {
text-align:center;
}
.tabs ul {
display: inline-block;
margin: 0px;
padding: 0px 0px 10px 0px;
/* For IE, the outcast */
zoom:1;
*display: inline;
}
.tabs li {
list-style:none;
display:inline-block;
text-align:center;
}
.tabs a {
padding:5px 10px;
display:inline-block;
background-color:#000000;
color:#FFFFFF;
text-decoration:none;
width:150px;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
-webkit-border-radius: 10px; /* Saf3-4, iOS 1-3.2, Android ≤1.6 */
-moz-border-radius: 10px; /* FF1-3.6 */
border-radius: 10px; /* Opera 10.5, IE9, Saf5, Chrome, FF4, iOS 4, Android 2.1+ */
}
.tabs a:hover {
background-color:#D7181E;
}
.tabs a.active {
padding:5px 10px;
display:inline-block;
background-color:#666666;
color:#FFFFFF;
text-decoration:none;
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}
</style> </head>
<body style=" background-color:#666666">
<div id="fb-root"></div>
<div style="display:block; width: 800px; margin:0px auto; background-color:#FFFFFF; border-width: 50px 50px 50px 50px; -moz-border-image: url(images/main-border-oil-grey.png) 71 repeat; -webkit-border-image: url(images/main-border-oil-grey.png) 71 repeat; -o-border-image: url(images/main-border-oil-grey.png) 71 repeat; border-image: url(images/main-border-oil-grey.png) 71 repeat;">
<!--banner-->
<div style="text-align:center;">
<img height="250" src="images/banner.jpg" alt="Chef's Classic Knock Out Bout" />
</div>
<!--links-->
<div class="tabs" style="text-align:center">
<ul>
<li> <a href="#pages-about">About</a> </li>
<li> <a href="#pages-facebook">News & Updates</a> </li>
<li> <a href="#pages-tickets">Tickets</a> </li>
</ul>
</div>
<!--pages-->
<div id="pages-about" style="min-height:400px;">
</div>
<div id="pages-facebook" style="min-height:400px;">
<div class="fb-like-box" data-href="http://www.facebook.com/pages/Chefs-Classic-Knock-OUT-Bout/225835004169328"
data-width="550" data-height="600" data-show-faces="false" data-border-color="#D7181E"
data-stream="true" data-header="true"> </div>
<!--<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FChefs-Classic-Knock-OUT-Bout%2F225835004169328&width=550&height=427&colorscheme=light&show_faces=false&border_color=%23D7181E&stream=true&header=true" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:550px; height:427px;" allowTransparency="true">
</iframe>--> </div>
<div id="pages-tickets" style="min-height:400px;">
</div>
</div>
</body>
<script type="text/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 = "http://connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script> <script type="text/javascript">
// Wait until the DOM has loaded before querying the document
$(document).ready(function(){
$('.tabs ul').each(function(){
// For each set of tabs, we want to keep track of
// which tab is active and it's associated content
var $active, $content, $links = $(this).find('a');
// Use the first link as the initial active tab
$active = $links.first().addClass('active');
$content = $($active.attr('href'));
// Hide the remaining content
$links.not(':first').each(function () {
$($(this).attr('href')).hide(); //assumes href contains div name
});
// Bind the click event handler
$(this).on('click', 'a', function(e){
// Make the old tab inactive.
$active.removeClass('active');
$content.hide();
// Update the variables with the new link and content
$active = $(this);
$content = $($(this).attr('href'));
// Make the tab active.
$active.addClass('active');
$content.show();
// Prevent the anchor's default click action
e.preventDefault();
});
});
});
</script>
</html>
最佳答案
我认为这是窗口滚动条的显示和隐藏。一旦您的所有选项卡中都有内容,这应该不是问题。
关于jquery - Facebook Like 按钮在 div 中显示时移动整个页面居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9267550/
我需要为登录用户生成一个建议列表。基本上是“既然你喜欢这些东西,而其他喜欢这些东西的人也喜欢这些东西,那么你可能也会喜欢这些东西”。 我可能会想出一个不错的算法来产生这样的结果,但在我重新发明轮子之前
此查询中有许多参数是用户可调整的,我希望用户能够创建一些文本文件,使用 sqlite3 db.sqlite ".read query.sql" > result.csv 运行查询,而不是直接将它们编辑
这个问题在这里已经有了答案: MySQL query finding values in a comma separated string (11 个回答) 11 个月前关闭。 我有一个名为 pape
我已将以下内容添加到我的 Blogger 模板中,以便在我的每个 Blogger 帖子上添加一个“赞”按钮: document.write('<iframe src="htt
当我点击“推荐”时,按钮打开的窗口隐藏(不可见)在页脚后面。其实我有截图来准确解释它:http://www.diigo.com/item/image/1q1ia/tw30 当然是XFBML,因为我知道
我在 facebook 上创建了一个页面“全民教育”。在我的网站中,我想提供一个点赞按钮来点赞此页面,而不是url,并且还想显示网站中该页面收到的点赞数以及点赞按钮。我使用了“添加这个”,但它显示了该
这个问题在这里已经有了答案: SQL Server, combining LIKE and IN? (3 个答案) 关闭 6 年前。 我想准备一个查询: SELECT name FROM Emplo
我有一个包含 200 条记录的表,其中 10 条记录的文本包含单词“TAX”。 当我执行时 Select * from tbl1 WHERE [TextCol] LIKE '%TAX%' 然后我正确地
我要执行查询: ---------------------- |name | ---------------------- |data
嗨,我正在为一个我没有设计的数据库编写 MySQL 请求,目前无法真正更改,我有一个问题,我还没有测试过这个,所以它可能按设计工作,但我没有当然。 所以我正在搜索的表只有三列 id、标题和描述,但描述
我已经尽力把这个问题说得很透彻了,所以如果你不耐烦,就跳到最后看看真正的问题是什么...... 我正在努力调整我们其中一个数据库中某些搜索功能的实现方式。为此,我正在向我们的应用程序 API 添加一些
我正在学习 MySQL,我尝试在查询中将“NOT LIKE”与“OR”结合起来,但没有成功。 假设我有一个 table1,其中有一列名为“word”,如下所示: word
Perl-Selenium 还提供了 Test::More 的标准方法,例如 ok()、like()、is() 等,也作为对象方法,例如$sel->like()。 ($sel 是 selenium p
我正在开发这个网站的前端:http://oq.totaleclips.com ,并从以下位置开发它:http://dev-jon.c2mx-hrd.appspot.com 我移动了社交按钮以使 UI
我正在创建一个搜索功能。我的 sql 查询使用 LIKE和 OR LIKE在 where 子句中。我正在搜索的表中的字段之一称为 quantity_types它只存储与在另一个表中找到的值相对应的代码
我有一个名为 platform 的表,其中有一列名为 entityid。 entityid 中的数据应该遵循 n.n.n 格式(其中 n = 1 个或多个数字,第一个数字是站点 ID)。 如果我运行这
所以,我正在练习考试(高中水平),虽然我们从未想过 SQL,但在处理 MS Access 时有必要了解一点. 任务是选择名称与其所属城镇不对应的区域ID。 解决方案中有以下示例: SELECT nam
1.作用与语法描述 作用: 正则表达式是使用指定字符串来描述、匹配一系列符合某个句法规则的字符串。许多程序设计语言都支持利用正则表达式进行字符串操作。MongoDB 使用 $regex 操作符来设
我们有一个网站,其中有文章页面,每个页面上都有一个类似 Facebook 的按钮,并与该文章 URL(URL 编码)相关联。例如,在一些带有 url http://www.site.com/artic
我在理解 SQL 中的 LIKE 和 NOT LIKE 运算符时遇到问题。这是我执行的查询: select serial_number from UNIT U group by serial_numb
我是一名优秀的程序员,十分优秀!