Bootstrap 游览模板未在所有按钮上应用 ID
Bootstrap tour template not applying id on all buttons
我在 bootstrap 导览中的模板标签之后为下一个按钮添加了一个 id 来设计它的样式。我将一个新的 id 应用到下一个按钮,但它只将它应用到第一个按钮,而不是后面的阶段。有谁知道为什么?
template: "<div class='popover tour'>
<div class='arrow'></div>
<h3 class='popover-title'></h3>
<div class='popover-content'></div>
<div class='popover-navigation'>
<button class='btn btn-default' data-role='prev'>« Prev</button>
<span data-role='separator'>|</span>
<button class='btn btn-default' id="thisone" data-role='next'>Next »</button>
</div>
<button class='btn btn-default' data-role='end'>End tour</button>
</nav>
</div>",
问题是您多次使用 id,请改用 class。 id 应该是唯一的。所以要小心。
来自:
id="thisone"
至:
class="thisone"
您可以在此处阅读有关此问题的更多信息:
我解决了。我使用 class 而不是 id 来定位元素,因为我的要求是一般性的而不是单一的。
.popover-navigation *[data-role="next"]{
background-color:#c6c6c6;
}
我在 bootstrap 导览中的模板标签之后为下一个按钮添加了一个 id 来设计它的样式。我将一个新的 id 应用到下一个按钮,但它只将它应用到第一个按钮,而不是后面的阶段。有谁知道为什么?
template: "<div class='popover tour'>
<div class='arrow'></div>
<h3 class='popover-title'></h3>
<div class='popover-content'></div>
<div class='popover-navigation'>
<button class='btn btn-default' data-role='prev'>« Prev</button>
<span data-role='separator'>|</span>
<button class='btn btn-default' id="thisone" data-role='next'>Next »</button>
</div>
<button class='btn btn-default' data-role='end'>End tour</button>
</nav>
</div>",
问题是您多次使用 id,请改用 class。 id 应该是唯一的。所以要小心。
来自:
id="thisone"
至:
class="thisone"
您可以在此处阅读有关此问题的更多信息:
我解决了。我使用 class 而不是 id 来定位元素,因为我的要求是一般性的而不是单一的。
.popover-navigation *[data-role="next"]{
background-color:#c6c6c6;
}