您好,我目前正在尝试在我的一张图像旁边放置图例,但在放置时遇到问题。
我想将图例放在图像的左侧或右侧。这是我当前的代码:
.my-legend .legend-title {
text-align: left;
margin-bottom: 5px;
font-weight: bold;
font-size: 90%;
}
.my-legend .legend-scale ul {
margin: 0;
margin-bottom: 5px;
padding: 0;
float: left;
list-style: none;
}
.my-legend .legend-scale ul li {
font-size: 80%;
list-style: none;
margin-left: 0;
line-height: 35px;
margin-bottom: 2px;
}
.my-legend ul.legend-labels li span {
display: block;
float: left;
height: 26px;
width: 40px;
margin-right: 15px;
margin-left: 0;
border: 1px solid #999;
}
.my-legend .legend-source {
font-size: 70%;
color: #999;
clear: both;
}
.my-legend a {
color: #777;
}
<img src="images/homeview.png" height="500">
<p><i>*Color coded home view example</i></p>
<hr>
<div class='my-legend'>
<div class='legend-scale'>
<ul class='legend-labels'>
<li><span style='background:#F7F7F7;'></span>Available</li>
<li><span style='background:#FFA500;'></span>Parked & Loaded</li>
<li><span style='background:#2E8B57;'></span>Parked & Unloaded</li>
<li><span style='background:#41B1E1;'></span>Docked</li>
</ul>
</div>
HUX布斯
PIPIONE
相关分类