1

我正在尝试在我的轮播右下角重新定位左右轮播按钮控件。但是,我不知道如何浮动左侧控件,因为不浮动右侧?

初始页面加载:

在此处输入图像描述

将页面拖得更宽后:

在此处输入图像描述

代码中不包含浮点数,但我已经尝试使用左控件使用浮点:右。

<a class="left carousel-control" href="#mainCarousel" data-slide="prev"  style="margin: 348px 0 0 770px">&lsaquo;</a>   
<a class="right carousel-control" href="#mainCarousel" data-slide="next"   style="margin: 348px -20px 0 0">&rsaquo;</a>

我尝试将两者都放入 div 并向右浮动,但不行。

我基本上希望两个轮播按钮在轮播的右下角彼此相邻。在页面加载时,我的边距将下一个/上一个按钮重新定位到右下部分,最初它们一起出现,但是当您将浏览器向右拖动时,它会扩大/拉伸控件并且控件分开(向右移动但左侧保持固定)。这是 JSFIDDLE -> http://jsfiddle.net/LneL8/

4

2 回答 2

0

这是你想要做的。例如,我取出了边距。 http://jsfiddle.net/ZS4KR/

 <div id="buttons">
    <p class="floatLeft"><a class="left carousel-control" href="#mainCarousel" data-slide="prev">Left</a> </p>

    <p class="floatRight"><a class="right carousel-control" href="#mainCarousel" data-slide="next">Right</a></p>
    </div>

CSS

.floatRight{
    float:right;
}
.floatLeft{
    float:left;
}

编辑:

我更新了你的小提琴http://jsfiddle.net/LneL8/1/

于 2013-06-27T01:37:31.163 回答
0

您是否试图将它们放在页面的两侧?

我查看了您的 jsFiddle,但看不到箭头。

但是假设您的箭头 HTML 代码是这样的:

<input type="button" class="leftArrow" value="left" />
<input type="button" class="rightArrow" value="right" />

要让左箭头向左“浮动”,右箭头向右“浮动”,请添加以下 CSS:

.leftArrow { position: relative; float: left; }
.rightArrow { position: relative: float: right; }

请记住:使职位“相对”很重要。否则花车将无法工作。

于 2013-06-27T01:38:03.797 回答