Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html ltr和rtl语言之间的popover宽度问题_Html_Css_Twitter Bootstrap_Bootstrap Popover - Fatal编程技术网

Html ltr和rtl语言之间的popover宽度问题

Html ltr和rtl语言之间的popover宽度问题,html,css,twitter-bootstrap,bootstrap-popover,Html,Css,Twitter Bootstrap,Bootstrap Popover,经过大量阅读和搜索,我的Popover几乎可以用不同的语言正常工作,除了以下问题: 在ltr语言(英语、法语、德语等)和rtl语言(阿拉伯语、希伯来语等)之间,我的语言宽度存在差异 在我的ltr语言中,popover的宽度仅为需要的宽度-最大宽度为600px;,如下所示: 在我的rtl语言中,popover的宽度是600px的最大宽度,而不是需要的宽度,如下所示: 我不确定为什么会发生这种情况。我读了很多很多的帖子,搜索过谷歌,但我无法解决这个问题 有人能指出为什么我的ltr和rtl语言弹出

经过大量阅读和搜索,我的Popover几乎可以用不同的语言正常工作,除了以下问题:

在ltr语言(英语、法语、德语等)和rtl语言(阿拉伯语、希伯来语等)之间,我的语言宽度存在差异

在我的ltr语言中,popover的宽度仅为需要的宽度-最大宽度为600px;,如下所示:

在我的rtl语言中,popover的宽度是600px的最大宽度,而不是需要的宽度,如下所示:

我不确定为什么会发生这种情况。我读了很多很多的帖子,搜索过谷歌,但我无法解决这个问题

有人能指出为什么我的ltr和rtl语言弹出框的宽度不同吗?我只想让rtl popover尽可能宽。这可能是一个简单的解决方案,但我看不出问题所在

以上两个屏幕截图显示了相同的信息(来自数据库),只是根据rtl/ltr语言使用了不同的CSS文件

这是我的ltr css代码:

.popover {
    direction: ltr;
    position: fixed;
    word-break: normal;
    word-wrap: break-word;
    z-index: 9999;
    background-color: lavender;
}

.popover.right {
    background-color: blueviolet;
    margin-left: 17px;
    max-width: 600px;
}

.popover.left {
    background-color: gold;
    margin-right: 0px;
    min-width: 375px;
}
.popover {
    direction: rtl;
    position: fixed;
    word-break: normal;
    word-wrap: break-word;
    z-index: 9999;
    background-color: khaki;
}

.popover.right {
    background-color: indianred;
    margin-left: 17px;
    min-width: 375px;
}

.popover.left {
    background-color: lightsteelblue;
    margin-left: -17px;
    max-width: 600px;
}
以下是rtlcss代码:

.popover {
    direction: ltr;
    position: fixed;
    word-break: normal;
    word-wrap: break-word;
    z-index: 9999;
    background-color: lavender;
}

.popover.right {
    background-color: blueviolet;
    margin-left: 17px;
    max-width: 600px;
}

.popover.left {
    background-color: gold;
    margin-right: 0px;
    min-width: 375px;
}
.popover {
    direction: rtl;
    position: fixed;
    word-break: normal;
    word-wrap: break-word;
    z-index: 9999;
    background-color: khaki;
}

.popover.right {
    background-color: indianred;
    margin-left: 17px;
    min-width: 375px;
}

.popover.left {
    background-color: lightsteelblue;
    margin-left: -17px;
    max-width: 600px;
}

在检查bootstrap-rtl.min.css中的.popover css类并更改不同的值之后,我成功地找到了这个问题的原因

bootstrap-rtl.min.css的.popover css类中有一个值:

.popover {
    ....
    right: 0;
    ....
}
以下是对此的描述

如果将上述值更改为以下值,则问题已得到解决:

.popover {
    ....
    right: 1;
    ....
}
对于rtl语言,popover仅显示所需宽度(最大宽度为600px)的问题已得到解决


我希望这会对某些人有所帮助。

你能用演示复制这个问题吗?Manoj Kumar-复制此问题很困难,因为页面/站点的语言方向不同-JSFIDLE不允许这样做。
right:1
不是有效的css值,必须使用此:
right:auto!重要的
,因此为了更好地显示arrow,可以使用以下命令:
.popover>.arrow、.popover>.arrow::after{left:0;}