如何去除背景图像周围的“填充”?
这里是一个演示: https://jsbin.com/dobucizaqi/edit?html,css,output
我尝试去除边距和填充,但没有成功。
我希望两个左边框对齐并且水平和垂直方向上去掉"padding"。
谢谢。
V.
这里是一个演示: https://jsbin.com/dobucizaqi/edit?html,css,output
.foo {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23f39c12' d='M3,19V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19M17,12L12,7V10H8V14H12V17L17,12Z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-size: 8em 8em;
height: 8em;
width: 8em;
}
.bar {
background-color: red;
align-items: center;
display: flex;
}
<div class="bar">
<div class="foo"></div>
<p>Lorem ipsum</p>
</div>
我希望两个左边框对齐并且水平和垂直方向上去掉"padding"。
谢谢。
V.
padding: 0px
呢? - Steven