python - 添加到 .css 文件的新 CSS 选择器不起作用;使用 Flask 和 Bootstrap

标签 python html css twitter-bootstrap flask

我正在使用 Bootstrap 示例之一(仪表板)。我正在使用 Python Flask 部署网站。

正在使用 Flask 成功调用 style.css 文件。

<!-- Bootstrap core CSS -->
<link href="{{ url_for('static', filename ='bootstrap.min.css') }}" rel="stylesheet">

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="{{ url_for('static', filename ='ie10-viewport-bug-workaround.css') }}" rel="stylesheet">

<!-- Custom styles for this template -->
<link href="{{ url_for('static', filename ='style.css') }}" rel="stylesheet">

一切正常,除非我将自己的 CSS 选择器添加到文件并尝试在 HTML 中调用它们。

比如我已经添加了

#profile_picture {
  width: 300px;
  height: 300px;
  border-radius: 150px;
  -webkit-border-radius: 150px;
  -moz-border-radius: 150px;
}
.flash_msg {
  background: #93ff9e;
  font-size: large;
  font-weight: bold;
}

到 style.css 文件,和

<img id="profile_picture" src="{{user[1]}}">

<li class="flask_msg">{{ message }}</li>

到 html,但没有任何反应。

这是 link to the full style.css文件。

这里是 one of the HTML templates .

这是 t he rest of the repo .

最佳答案

您的 CSS 正在您的 github 上寻找 #profile_picture 的 img 子级。

关于python - 添加到 .css 文件的新 CSS 选择器不起作用;使用 Flask 和 Bootstrap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45988589/

相关文章:

html - 使 CSS Grid 填充 CSS Flexbox 列中的所有可用空间

python - PyOpenSSL 将证书对象转换为 .pem 文件

javascript - 在 Summernote 中使用 <br> 而不是 <p>?

css - 字体在 Django 中不起作用

css - @media 屏幕的 css 在 Visual Studio 2015 中不起作用

javascript - 计算 ul 中所有第一个列表项

python - 尝试在 python 中安装库时,如何修复构建环境中不可用的设置工具?

python - 从numpy中的另一个数组中减去数组数组

python - 查找列表中的最大元素

html - 纯 CSS 标签 : absolute positioning