Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html CSS线条高度不影响浮动:右元素_Html_Css_Twitter Bootstrap - Fatal编程技术网

Html CSS线条高度不影响浮动:右元素

Html CSS线条高度不影响浮动:右元素,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我有两个跨度元素,我试图垂直居中,我通过将线高度与父元素的高度匹配,成功地将左元素居中,但是右元素的样式为float:right不受线高度更改的影响,这有什么原因吗?我怎样才能使浮动的元素垂直居中呢 HTML 注意:我也在使用引导只是元素的内联内容受设置行高的影响。浮动元素是块,这就是行高度不起作用的原因 将行高设置为箭头,而不是包装。我将float设置为两个spans,当您将float:right设置为第二个时,左箭头保持为inline元素,下一个箭头将低几个像素 .slideshow-hol

我有两个跨度元素,我试图垂直居中,我通过将线高度与父元素的高度匹配,成功地将左元素居中,但是右元素的样式为float:right不受线高度更改的影响,这有什么原因吗?我怎样才能使浮动的元素垂直居中呢

HTML


注意:我也在使用引导

只是元素的内联内容受设置
行高的影响。浮动元素是
,这就是
行高度
不起作用的原因

行高设置为箭头,而不是包装。我将
float
设置为两个
span
s,当您将
float:right
设置为第二个时,左箭头保持为
inline
元素,下一个箭头将低几个像素

.slideshow-holder {
    background:url('../res/images/abwallpaper.jpg');
    height:300px;
}

.slideshow-holder span {float: left; line-height: 300px;}
#slideshow_next_button {float: right;}

这非常有效,我的箭头垂直居中。不过有一件事,我给了我的箭头一个边界半径,以尝试创建一个圆形作为背景,但是线条的高度将它们延伸出来:有没有办法保持圆形并使其垂直居中?圆形CSS:#幻灯片放映#上一个按钮#幻灯片放映(下一个)按钮{填充:20px;边框半径:20px;背景:rgba(255255,0.3);边框:2px实心rgba(255255,0);}
.slideshow-holder
{
    background:url('../res/images/abwallpaper.jpg');
    height:300px;
    line-height:300px;
}
.slideshow-holder {
    background:url('../res/images/abwallpaper.jpg');
    height:300px;
}

.slideshow-holder span {float: left; line-height: 300px;}
#slideshow_next_button {float: right;}