我的 Css 如下我尝试将“+”图标向右移动一点但是没有移动它,有人可以帮忙吗?
.button-sec-icon {
background-color: #fdfdfd;
cursor:pointer;
background: transparent url("images/basicsetup/plus.png") no-repeat left!important;
margin-right: 5px;
border: 2px solid #EEEEEE;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 3px 1px rgba(0, 0, 0, 0.2);
color: #ca2b2b;
display: block;
height: 28px;
margin: 10px 0 0 60px;
transition: all 0.5s ease 0s;
min-width: 150px;
width: 121px;
}
.button-sec-icon:hover {
border :1px solid #888;
box-shadow: 0 4px 1px rgba(0, 0, 0, 0.2);
}
最佳答案
您需要使用 background-position
background: transparent url("images/basicsetup/plus.png") no-repeat left!important;
所以不要使用left
,而是使用
background-position: 10px 0; /* Parameters are X and Y respectively */
关于css - 如何在 css 中将 "+"向右移动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19044916/