我找到了一个我想使用的卡片转盘的代码笔示例。然而,bootstrap样式表使carousel不能正常工作。当我删除样式表时,旋转木马可以工作,但它会更改页面的样式,我需要它与其他页面保持一致。
这是我用于旋转木马卡的代码笔示例。https://codepen.io/kreigd/pen/ybYNoN
我使用的代码正是上面链接中的示例所示的代码

<!-- I can only keep the 2 style sheet below and maintain my personal styling
but the card carousel will not work-->

<link href="bootstrap/css/bootstrap-grid.min.css" rel="stylesheet" />
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />

<!-- or I remove the 2 above and add this. This makes the card carousel
work but my personal styling will be changed and not consistent with my
other pages -->

<link rel='stylesheet'
href='https://cdnjs.cloudflare.com/ajax/libs/twitter-
bootstrap/4.0.0/css/bootstrap.css'>

我需要帮助,让我保持我原来的风格,同时得到旋转木马卡的工作。

最佳答案

无论何时声明或调用最新的,样式属性都依赖于它。<link href="bootstrap/css/bootstrap-grid.min.css" rel="stylesheet" /><link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />中的某些属性将与您在旋转木马上使用的属性相同。
只有一种解决方案,要么您必须提供css属性,以便carousel通过从引导程序中选择它们来工作,要么您必须从carousel引导程序中删除不必要的属性,这些属性会影响页面的主设计。

07-24 17:44
查看更多