当你在 Visual Studio 中创建一个新的 MVC 元素时,你会得到这个布局:
如果您在超大屏幕(ASP.NET 容器)上单击检查,您将在样式上获得此类:
.jumbotron {
padding: 30px;
margin-bottom: 30px;
font-size: 21px;
font-weight: 200;
line-height: 2.1428571435;
color: inherit;
background-color: #eeeeee;
}
它的 background-color
定义为 #eeeeee
,实际上就是您在上面看到的灰色。
但是如果你检查“关于”按钮,background-color
什么都没有,只有 body
的继承,但那是白色 #ffffff
。我使用颜色选择器工具发现黑色实际上是 #222222
但我没有在检查代码中看到它。
那么在哪里定义菜单布局的background-color
呢?
最佳答案
我打赌背景颜色的样式在 navbar-nav 类中。由于 chrome inspector 只显示应用于所选元素的样式,它不会显示仅应用于父元素的背景颜色。
关于html - 菜单布局中背景颜色的样式在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50688371/