Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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
Twitter bootstrap 如何在popover引导中水平对齐html div元素?_Twitter Bootstrap_Css_Twitter Bootstrap 3 - Fatal编程技术网

Twitter bootstrap 如何在popover引导中水平对齐html div元素?

Twitter bootstrap 如何在popover引导中水平对齐html div元素?,twitter-bootstrap,css,twitter-bootstrap-3,Twitter Bootstrap,Css,Twitter Bootstrap 3,我使用的是bootstrap3。我想在一个popover中水平对齐两个div元素,但我不知道应用样式来设置属性display:inline block。你知道我怎样才能做到吗 我尝试用另一个div包装它们,并将此属性设置为inline block为parent div,但没有成功 $('#tag-input').popover({ container: 'body', trigger: "manual", html: "tr

我使用的是bootstrap3。我想在一个popover中水平对齐两个div元素,但我不知道应用样式来设置属性
display:inline block。你知道我怎样才能做到吗

我尝试用另一个div包装它们,并将此属性设置为
inline block
为parent div,但没有成功

$('#tag-input').popover({
            container: 'body',
            trigger: "manual",
            html: "true",
            animation: true,
            content: "<div>First row</div><div>Second row</div>"
        });
$(“#标记输入”).popover({
容器:'主体',
触发器:“手动”,
html:“正确”,
动画:没错,
内容:“第一行第二行”
});

只需使用
class=“row”
将两个div包装在一个div中即可。然后,您可以将
class=“col-xs-6”
添加到它们中的每一个,这样它们就占据了popover的50%宽度

$(“#标记输入”).popover({
容器:'主体',
触发器:“悬停”,
位置:“底部”,
html:“正确”,
动画:没错,
内容:“第一行第二行”
});

只需使用
class=“row”
将两个div包装在一个div中即可。然后,您可以将
class=“col-xs-6”
添加到它们中的每一个,这样它们就占据了popover的50%宽度

$(“#标记输入”).popover({
容器:'主体',
触发器:“悬停”,
位置:“底部”,
html:“正确”,
动画:没错,
内容:“第一行第二行”
});

感谢您的回复。但是我有另一个情况,div的数量是未知的。它们是由家庭创造的。因此,我必须平均地为每一个分隔空间。你知道我该怎么做吗,因为正如你在上面解释的,col的大小不是动态的。谢谢你的回答。但是我有另一个情况,div的数量是未知的。它们是由家庭创造的。因此,我必须平均地为每一个分隔空间。你知道我该怎么做吗,因为正如你上面解释的,列大小不是动态的。
$('#tag-input').popover({
    container: 'body',
    trigger: "hover",
    position: "bottom",
    html: "true",
    animation: true,
    content: "<div class='row'><div class='col-xs-6'>First row</div><div class='col-xs-6'>Second row</div></div>"
});