css-图片按钮

1、使用button
<button type="button" id="but1"></button>

2、css样式
图片尺寸:440px × 586px
要先定义按钮大小: width: 220px; height: 220px;

#but1 {
  border: 0;
  width: 220px;
  height: 220px;
  background: url(http://img.hb.aicdn.com/1e4611a6d81235f8e3d4a08e2a971598eed7123eae89-g2dIl2_fw658);
  background-size: 100%;
  border: 2px solid #4abe43;
  border-radius: 50%;
}

设置形状:圆形 border-radius: 50%;
①border-radius 半径,四个值:左上 右上 右下 左下(顺时针)
②background-size 如果只给出一个值,第二个是设置为”auto(自动)”

效果图:

猜你喜欢

转载自blog.csdn.net/asuna_yu/article/details/80269795
今日推荐