html - 如何在 Bootstrap 中将此 <a> 标记置于此模式的中心?

标签 html css twitter-bootstrap layout bootstrap-modal

你好谢谢你看我的问题,

我正在努力将此链接置于 Bootstrap 中的模态中心。我没有使用网格系统或行。模态中有一个 BS 轮播,我可以使用 margin:0 auto;

将元素居中

这是链接位置的可视化,它顽固地停留在模式的左侧。

Click Here to see image

链接应该在轮播指示器的正下方。

HTML 片段:

.
.
.
<div>
    <ol>
        <li> data-slide-to="1"></li>
        <li data-target="#home-price-guide-carousel" data-slide-to="2"></li>
    </ol>

</div>

<a class="btn-center" href="#">Continue</a>

<div class="modal-footer">

</div>
.
.
.

相关 CSS:

.btn - center {
    color: #95d63b;
    margin:0 auto;
    float:none;
}

基本上,我如何让 btn-center 真正居中。

最佳答案

2个选项:

  1. text-align:center;

  2. .btn-center{ 颜色:#95d63b; position:absolute; 变换:翻译(-50%,-50%); 左:50%; }

可以试试here

关于html - 如何在 Bootstrap 中将此 <a> 标记置于此模式的中心?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35689429/

相关文章:

html - 按比例(动态但没有固定图像尺寸)将完整图像调整为 div 容器,而不拉伸(stretch)到容器的每一侧

javascript - 带有用于垂直滚动的水平控件的 HTML 滚动框

html - 防止内联 block 元素扩展到容器之外

html - :hover, 焦点等所有状态的 css 通配符?

twitter-bootstrap - Bootstrap - 列表组项中的输入组按钮

java - Play 2.5 元素中损坏的 CSS 链接

html - 什么是 aria-label 以及我应该如何使用它?

javascript - Onclick 使用 jQuery 在另一个 div 中更改图像源

css - 以下代码中使用的 css 语法有什么用?

html - 垂直对齐 Div 内的图像