我对python的web开发还不熟悉。我正在把一个项目从php转换成flask。我遵循了这篇文章(Application not picking up .css file (flask/python))中的说明,现在我的文本居中,所以我知道我链接到了我的样式表。但我的页面上没有任何颜色。不知道我做错了什么。这是我的css文件:
body {
background-color: #003300;
text-align: center;
}
.greenones{
color: #003300;
text-align: center;
}
.redones{
color: #dd164e;
text-align: center;
}
.yellowones{
color: #CA9800;
text-align: center;
}
.orangeones{
color: #ff6600;
text-align: center;
}
.centerMe{
text-align: center;
}
.dropdown-toggle{
color: #CA9800;
}
.yellowleft{
color: #CA9800;
text-align: left;
}
.leagueguide{
color: #CA9800;
text-align: left;
list-style-type: upper-roman;
}
.leagueguide-indent{
color: #CA9800;
text-align: left;
list-style-type: upper-alpha;
}
.leagueguide-decimal{
color: #CA9800;
text-align: left;
list-style-type: decimal;
}
div.well {
font-weight: bold;
}
a {
font-weight: bold;
}
img.align-left {
float: left;
margin-right: 10 px;
text-align: left;
}
label.yellow, div.yellow{
color: #CA9800;
}
label.logs{
color: #CA9800;
text-align: right;
padding: 10px 10px 10px 10px;
}
table.statsTable{
text-align: center;
color: #003300;
padding: 3px;
}
td.cen {
text-align: center;
}
#login-dp{
min-width: 250px;
padding: 14px 14px 0;
overflow:hidden;
background-color:rgba(255,255,255,.8);
}
#login-dp .help-block{
font-size:12px
}
#login-dp .bottom{
background-color:rgba(255,255,255,.8);
border-top:1px solid #ddd;
clear:both;
padding:14px;
}
#login-dp .social-buttons{
margin:12px 0
}
#login-dp .social-buttons a{
width: 49%;
}
#login-dp .form-group {
margin-bottom: 10px;
}
.btn-fb{
color: #fff;
background-color:#3b5998;
}
.btn-fb:hover{
color: #fff;
background-color:#496ebc
}
.btn-tw{
color: #fff;
background-color:#55acee;
}
.btn-tw:hover{
color: #fff;
background-color:#59b5fa;
}
@media(max-width:768px){
#login-dp{
background-color: inherit;
color: #fff;
}
#login-dp .bottom{
background-color: inherit;
border-top:0 none;
}
}
编辑我的问题:找不到我的css文件。我得到了这个错误:
^{pr2}$在我的布局.html文件,我有一行:
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='ibc.css') }}">
我在app文件夹下创建了一个静态文件夹(其中应用程序副本,并将.css文件放在那里。这显然不是正确的位置。。。在
我可以回答我自己的问题。我需要在每个.html文件中包含指向样式表的链接,而不仅仅是布局.html. 一旦我这样做了,css就开始工作了。在
相关问题 更多 >
编程相关推荐