设计切割时如何去除空白区域(css)

时间:2015-05-28 20:23:37

标签: css

HTML:

.test {
background: #000 url('../img/bg.png');
background-repeat: no-repeat;
background-position: left;
text-indent: 17px;
color:#FFFFFF;
border: none; 
padding: 0 0 0 10px; 
top: 0;  
outline: none; 
font-size: 22px; 
position: relative; 
width: 100%; 
height: 50px;
} 

的CSS:

left:20px;

看起来像这样: http://s24.postimg.org/e0l3ak6xx/image.png

如何使它像这张照片: http://s7.postimg.org/5pfmf041n/image.png

我试过了:

left:20px;

但是当设计剪切(响应式设计)时,我的搜索形式如下:{{1}}我有20px的空白区域,如何在设计剪切时删除这个20px的空白空间?

1 个答案:

答案 0 :(得分:2)

设置background-position: 20px center;

.test {
    background: #000 url('../img/bg.png');
    background-repeat: no-repeat;
    background-position: 20px center;
    text-indent: 37px;
    color:#FFFFFF;
    border: none; 
    padding: 0 0 0 10px; 
    top: 0;  
    outline: none; 
    font-size: 22px; 
    position: relative; 
    width: 100%; 
    height: 50px;
}