html - Facebook 登录按钮样式

标签 html css facebook

我有这段代码来显示登录 facebook 按钮

<span style="float:right; height:40px; line-height:45px;vertical-align:top; 
font-size:14px; padding-right:10px; "><?php if($this->tank_auth->is_logged_in())
{    echo "Welcome " .anchor('profile',$this->tank_auth->get_username())." | ".anchor
    ('profile/find_friends','Find Friends')." | ".anchor('auth/logout','Logout');} 
   else {?><?php echo  anchor('auth/login','Login'); ?> | 
  <fb:login-button v="2" perms="" length="long" 
  onlogin='window.location="https://graph.facebook.com/oauth/authorize?client_id=<?php echo  
$this->config->item('facebook_app_id'); ?>&redirect_uri=<?php echo site_ur
('auth_other/fb_signin'); ?>&amp;r="+window.location.href;'></fb:login-button><?php } ?></span>
            <div style="clear:both"></div>

当我浏览页面时,这段代码转换为:

<fb:login-button v="2" perms="" length="long" 
   onlogin="window.location=&quot;https://graph.facebook.com/oauth/authorize? 
   client_id=372198139465874&amp; 
  redirect_uri=http://allviralvideo.org/auth_other/fb_signin&amp;r=&quot;+window.location.href;" 
  login_text="" class=" fb_iframe_widget" fb-xfbml-state="rendered" fb-iframe-plugin-  
  query="app_id=372198139465874&amp;locale=en_US&amp;sdk=joey">
  **<span style="vertical-align: bottom; width: 69px; height: 22px; ">**<iframe 
  name="f1d6c3fee8" width="1000px" height="1000px" frameborder="0" allowtransparency="true" 
  scrolling="no" title="fb:login_button Facebook Social Plugin" style="border-top-style: none; 
  border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: 
  initial; border-color: initial; width: 69px; height: 22px; visibility: visible; " 
  src="http://www.facebook.com/plugins/login_button.php?app_id=372198139465874&amp;channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D28%23cb%3Df11db3306c%26domain%3Dallviralvideo.org%26origin%3Dhttp%253A%252F%252Fallviralvideo.org%252Ff72d2ade4%26relation%3Dparent.parent&amp;locale=en_US&amp;sdk=joey" class=""></iframe></span></fb:login-button>

我想删除 vertical-align: bottom;来自粗体部分。我添加了 vertical-align: top;到父标签,但它会抑制它们。有什么办法可以去掉吗?

最佳答案

您可以使用 Facebook 按钮的直接父级来定位 CSS 中的跨度。像这样的东西:

.parent span {
    vertical-align: top !important;
}

由于它会生成内联样式,因此您需要使用 !important 否则它将被覆盖。

您也可以直接在 CSS 中定位 fb 元素,但我从未使用过它,所以我不能确定。

关于html - Facebook 登录按钮样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19714005/

相关文章:

html - CSS 子字符串显示无

数字范围为 1-5 的 JavaScript switch case

jquery - 编辑菜单栏的CSS脚本

jquery - 背景图像在鼠标悬停时闪烁

html - 将鼠标悬停在文本幻灯片上以显示更多文本

javascript - 添加另一个 js 文件中存在的方法的事件监听器

facebook - FB Graph API - 如何检测页面是否已合并并获取正确页面的 ID?

android - Facebook 图形 API : Paging next newsfeed return data empty

php - 在 WHILE 语句期间删除结果

javascript - ASP.NET 服务器控件 - 根据下拉选择显示隐藏文本框