我想將圖標字體<span>
標記與行中的文本<span>
對齊。看起來如果兩個<span>
是一致的,但圖標以某種方式「浮動」在div上。將圖標字體跨度與行中的文本跨度對齊
.navigation {
padding-left: 50px;
padding-top: 50px;
padding-bottom: 50px;
}
.navigation .counter {
background: red;
vertical-align: middle;
font-size: 13px;
}
.navigation span {
background: green;
padding-bottom: 0px;
}
.navigation .material-icons {
font-size: 21px;
}
<head>
<meta charset="utf-8" />
<script>
document.write('<base href="' + document.location + '" />');
</script>
<link href="style.css" rel="stylesheet" />
<script data-semver="1.3.20" src="https://code.angularjs.org/1.3.20/angular.js" data-require="[email protected]"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<div class="navigation">
<span><i class="material-icons">arrow_drop_down</i></span>
<span><i class="material-icons">arrow_drop_up</i></span>
<span class="counter">select floor</span>
</div>
那麼我該如何調整圖標和文本,該文本是在圖標的垂直中心?