相同的代码在 .vue 中和 在 .html 中样式展示不同
Vue version
3.3.4
Link to minimal reproduction
——
Steps to reproduce
app.vue:
<template>
<div class="box">
<div class="inner">
<div class="text">加载失败</div>
</div>
</div>
</template>
<style >
.box {
background-color: blue;
}
.inner {
display: inline-block;
}
.text {
font-size: 12px;
background-color: #eee;
}
</style>
index.html
<style>
.box {
background-color: blue;
}
.inner {
display: inline-block;
}
.text {
font-size: 12px;
background-color: #eee;
}
</style>
<body>
<div class="box">
<div class="inner">
<div class="text">加载失败</div>
</div>
</div>
</body>
Style rendering:
What is expected?
Maintain consistency between .vue style and .html
What is actually happening?
Inconsistency between .vue style and html
System Info
window11
Any additional comments?
No response