【发布时间】:2014-01-29 04:40:43
【问题描述】:
我有一个 Twitter 引导轮播在我的网页上运行良好,但我无法让侧箭头按照我想要的方式运行。我的 CSS 知识可能是 10 分中的 5 分。
目前,“字形”箭头从窗口的左右边缘绝对定位。当我缩小或扩大窗口时,这些箭头与窗口边缘的距离完全相同。这是奇怪和错误的,因为它们在轮播图像的顶部到处移动。我希望它们保持在轮播图像上的固定位置,而不是浏览器窗口上。我还需要将字体字形更改为透明图像。
点击时左右箭头会滚动轮播。它们不是图像,它们是字形,我猜这是某种奇怪的字体。这是 HTML:
<a href="#myCarousel" class="left carousel-control" data-slide="prev" style="width:0px"><span class="glyphicon glyphicon-chevron-left"></span></a>
<a href="#myCarousel" class="right carousel-control" data-slide="next" style="width:0px"><span class="glyphicon glyphicon-chevron-right"></span></a>
这是 href 的 css:
.carousel-control {
background: #343432;
position: absolute;
top: 0;
bottom: 0;
left: 0;
width: 15%;
font-size: 20px;
color: #ffffff;
text-align: center;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
这是内部跨度的 css:
.glyphicon-chevron-right {
position: absolute;
top: 50%;
z-index: 5;
display: inline-block;
}
还有:
.glyphicon {
font-family: 'Glyphicons Halflings';
-webkit-font-smoothing: antialiased;
font-style: normal;
font-weight: normal;
line-height: 1;
-moz-osx-font-smoothing: grayscale;
}
虽然它没有显示在原始 html 中,但当通过 Chrome 开发工具栏检查器查看时,在跨度内我看到了这个:
::before
所以我需要知道如何更改箭头位置以保持相对于轮播图像而不是浏览器窗口的固定。我需要将字形更改为我拥有的一些透明箭头。
如果您想检查任何元素,这是实际的网页: http://www.zerogravpro.com/temp/bootstrap/
谢谢。
【问题讨论】:
标签: css twitter-bootstrap