我有一个svg图标svgIcon的来源。我需要将这个图标添加到按钮中。它看起来很像这个

我试过这个:
css
.btn {
border: none;
color: grey;
padding: 12px 16px;
font-size: 16px;
cursor: pointer;
background-image: url("http://alexfeds.com/wp-
content/uploads/2018/04/save_icon.svg");
background-repeat: repeat-y;
}
<button class="btn"> Save</button>但其结果是:

如何在按钮内有svg图标和旁边的文字描述?
发布于 2018-04-24 09:21:26
.custom-btn .ico-btn {
color: grey;
padding: 12px 16px 12px 40px;
background:url(http://alexfeds.com/wp-content/uploads/2018/04/save_icon.svg) no-repeat 13px 9px;
background-size: 25px auto;
background-color:#eaeaea;
}<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<div class="custom-btn">
<button class="btn ico-btn">Button </button>
<div>
https://stackoverflow.com/questions/49997745
复制相似问题