{{1}}
当我编译此代码时,它会收到错误"无法将预期类型'Double'与实际类型'Integer'匹配"
有什么建议吗?
答案 0 :(得分:3)
html {
font-size: 1.2rem;
}
* {
padding: 0;
margin: 0;
}
header {
background-color: black;
padding: 1rem;
height: 20px;
}
.main-nav {
display: flex;
}
.main-nav li {
padding-right: 1rem;
}
.main-nav li a {
text-decoration: none;
}
.items {
list-style: none;
position: relative;
right: 15px;
}
nav {
list-style: none;
}
.items li {
line-height: 2.5rem;
}
.items li a {
font-size: 1rem;
text-decoration: none;
background-color: red;
padding: 0.5rem;
}
.items-after-sub-list{
position: relative;
bottom: 143px;
}
.sub-items {
position: relative;
left: 72px;
bottom: 48px;
list-style: none;
}
.sub-items li a {
color: black;
background-color: green;
}
li a {
transition: background 1s;
}
nav a:hover {
background-color: silver;
}
nav > li:hover > ul {
display: block;
}
是x
,您将其与十进制值相乘以生成Integer
。算术运算符(如Float
)的操作数和结果必须属于同一类型,并且必须明确地在类型之间进行转换。
(*)