Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 以图像为背景的css按钮_Html_Css_Image_Background_Background Image - Fatal编程技术网

Html 以图像为背景的css按钮

Html 以图像为背景的css按钮,html,css,image,background,background-image,Html,Css,Image,Background,Background Image,CSS HTML 这是我的按钮图像的html和css我的问题是如何去除图像之外的背景我指的是图像后面的矩形我的图像没有背景,因为它看起来像使用背景作为透明 #printbutton{ width: 156px; height: 63px; background-image: url(../images/Untitled_1.png); background-repeat: no-repeat; } 使用背景作为透明 #printbutton{ widt

CSS

HTML


这是我的按钮图像的html和css我的问题是如何去除图像之外的背景我指的是图像后面的矩形我的图像没有背景,因为它看起来像

使用背景作为透明

#printbutton{
    width: 156px;
    height: 63px;
    background-image: url(../images/Untitled_1.png);
    background-repeat: no-repeat;
}

使用背景作为透明

#printbutton{
    width: 156px;
    height: 63px;
    background-image: url(../images/Untitled_1.png);
    background-repeat: no-repeat;
}

将按钮塑造为图像,添加按钮高度、宽度和边框半径

button{
  margin      : 0;
  padding     : 0;
  border      : 0;
  background  : transparent;
  font-family : inherit;
  font-size   : 1em;
  cursor      : pointer;
}

将按钮的形状设置为图像,添加按钮的高度、宽度和边框半径

button{
  margin      : 0;
  padding     : 0;
  border      : 0;
  background  : transparent;
  font-family : inherit;
  font-size   : 1em;
  cursor      : pointer;
}