【发布时间】:2017-11-16 18:40:48
【问题描述】:
我创建了一个简单的绿色登录(通过 Gmail)按钮。 请看这个
<!DOCTYPE html>
<html>
<head>
<style>
.button {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.button:icon {
background: url(gmail-icon.png) no-repeat;
float: left;
width: 10px;
height: 40px;
}
</style>
</head>
<body>
<button class="button"><span class="icon"></span>Button</button>
</body>
但我在按钮上看不到我的图标。 请告诉我为什么?
【问题讨论】:
-
你的选择器应该是
.button .icon