我有一个本地 /swagger-ui.html
由不同的包/库提供。我想修改样式,因此我考虑将其嵌入到我自己的 index.html
中并添加一些 css
样式覆盖:
index.html:
<head>
<link rel="stylesheet" href="styles.css">
<link rel="import" href="/swagger-ui.html">
</head>
styles.css(同一文件夹):
.swagger-ui .scheme-container,
.swagger-ui .topbar {
background-color: red !important;
display: none !important;
}
结果:我没有看到样式有任何变化。为什么?
最佳答案
尝试切换以下行
<link rel="stylesheet" href="styles.css">
<link rel="import" href="/swagger-ui.html">
到:
<link rel="import" href="/swagger-ui.html">
<link rel="stylesheet" href="styles.css">
关于html - 如何嵌入外部html并更改css样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57372811/