【发布时间】:2021-04-18 20:51:54
【问题描述】:
我在 Asp.net 中添加了一些 css 来格式化表格,在编辑器中它看起来正是我想要的,但是当我启动我的应用程序时,当我检查源代码时表格的 css 丢失了,有人知道我在做什么吗做错了,是设计器有问题还是我的代码有问题?
Visual Studio 中的 My Site.css
/* Move down content because we have a fixed navbar that is 50px tall */
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 1px;
padding-right: 1px;
}
/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
max-width: 280px;
}
/* Tables */
table, th, td {
border: 1px solid black;
}
table{
width:100%;
}
tr:nth-child(even){
background-color: #eee;
}
tr:nth-child(odd){
background-color: #fff;
}
th{
color: white !important;
background-color: black !important;
}
/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
.jumbotron {
margin-top: 20px;
}
.body-content {
padding: 0;
}
}
当我使用 Opera 检查器检查 Site.css 时
/* Move down content because we have a fixed navbar that is 50px tall */
body {
padding-top: 50px;
padding-bottom: 20px;
}
/* Wrapping element */
/* Set some basic padding to keep content from hitting the edges */
.body-content {
padding-left: 1px;
padding-right: 1px;
}
/* Set widths on the form inputs since otherwise they're 100% wide */
input,
select,
textarea {
max-width: 280px;
}
/* Responsive: Portrait tablets and up */
@media screen and (min-width: 768px) {
.jumbotron {
margin-top: 20px;
}
.body-content {
padding: 0;
}
}
【问题讨论】: