简体   繁体   English

评论时,Facebook上Facebook登录按钮的宽度

[英]Width of login button of facebook when commenting, on mobiles

Im browsing my site on mobile phone. 我在手机上浏览我的网站。 An article can be commented: 可以评论一篇文章:

The problem is, when Im not logged in, a button appears to log in. But it looks alike: 问题是,当我未登录时,会出现一个按钮来登录。但是看起来很像:

|                     |
|                     |
|Login here to send po|
|                     |
|                     |

so (in my native language) the button has more width than the width of device. 因此(以我的母语)按钮的宽度大于设备的宽度。 How to set 100% width for this button? 如何为此按钮设置100%宽度?

EDIT: sorry I forgot: 编辑:对不起,我忘记了:

<div class="flbCont" style="background-color: red; width: 100%;">
<div class="fb-comments" data-href="fladinflakk" data-numposts="5"  width="100%" data-colorscheme="light"></div>
</div>

In this example I am going to use media queries to change the width from a fixed size (300px) to 100% width. 在此示例中,我将使用媒体查询将宽度从固定大小(300px)更改为100%宽度。

Here is the media query that will change the styles when it detects a change in size and device. 这是媒体查询,它将在检测到大小和设备更改时更改样式。

@media only screen and (max-width: 680px) {
    .login {
        width: 100%;
    }
}

Make sure you include 确保包括

<meta name="viewport" content="width=device-width, initial-scale=1.0;">

in your head tag. 在您的head标签中。 This will allow the media queries to detect the device and then know to make the changes. 这将使媒体查询能够检测到设备,然后知道进行更改。

Here is a fiddle: Demo 这是一个小提琴: 演示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM