css - 如何在 css 中将 "+"向右移动?

标签 css

enter image description here

我的 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/

相关文章:

css - Nginx 不会在树莓派的 Asp.net 核心上加载 css

Javascript 菜单设置类激活

Firefox 上的 HTML 行表高度

android - 如何从 assets 文件夹中的 HTML 文件访问 drawable 文件夹中的图像?

html - float div 在浏览器缩放时向左添加空间

css 全宽高度固定可滚动容器

html - 获得一个正确的方法来设计复选框,而不是后面跟着标签标签

CSS: font-family,如果不是一种字体,则完全没有

asp.net - 中心 ASP 母版页

javascript - flex 容器子容器的 scrollWidth 不正确