【问题标题】:Trying to change background gradient in css for flask application尝试更改烧瓶应用程序的 CSS 中的背景渐变
【发布时间】:2020-06-22 19:10:09
【问题描述】:

我使用我在网上找到的模板创建了一个烧瓶应用程序。我不精通html或css。调用应用程序后,我意识到网页的背景有一个由红到蓝的渐变,我想将其更改为常规的深蓝色。您能否让我知道我可以在代码中的哪个位置执行此操作。代码粘贴在下面。提前致谢。

我尝试在多个地方将 background-image 更改为 none 并将背景更改为 #e6e6e6(代表我想要的蓝色),但它仍然不起作用

@import url(https://fonts.googleapis.com/css?family=Open+Sans);
.btn { display: inline-block; *display: inline; *zoom: 1; padding: 4px 10px 4px; margin-bottom: 0; font-size: 13px; line-height: 18px; color: #333333; text-align: center;text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); vertical-align: middle; background-color: #00008B; }
.btn-large { padding: 9px 14px; font-size: 15px; line-height: normal; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }
.btn:hover { color: #333333; text-decoration: none; background-color: #e6e6e6; background-position: 0 -15px; -webkit-transition: background-position 0.1s linear; -moz-transition: background-position 0.1s linear; -ms-transition: background-position 0.1s linear; -o-transition: background-position 0.1s linear; transition: background-position 0.1s linear; }
.btn-primary, .btn-primary:hover { text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); color: #ffffff; }
.btn-primary.active { color: rgba(255, 255, 255, 0.75); }
.btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] { filter: none; background-color: #4a77d4; }
.btn-block { width: 100%; display:block; }

* { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; -ms-box-sizing:border-box; -o-box-sizing:border-box; box-sizing:border-box; }

html { width: 100%; height:100%; overflow:scroll; }

body { 
    width: 100%;
    height:100%;
    font-family: 'Open Sans', sans-serif;
    background-image: none;
    background-color: #e6e6e6;
    color: #fff;
    font-size: 18px;
    text-align:center;
    letter-spacing:1.2px;

}
.login { 
    position: absolute;
    top: 40%;
    left: 50%;
    margin: -150px 0 0 -150px;
    width:400px;
    height:450px;
}

.login h1 { color: #fff; text-shadow: 0 0 10px rgba(0,0,0,0.3); letter-spacing:1px; text-align:center; }

input { 
    width: 100%; 
    margin-bottom: 15px; 
    background-image:none;
    background: #e6e6e6;
    border: none;
    outline: none;
    padding: 10px;
    font-size: 13px;
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
    border: 1px solid rgba(0,0,0,0.3);
    border-radius: 4px;
    box-shadow: inset 0 -5px 45px rgba(100,100,100,0.2), 0 1px 1px rgba(255,255,255,0.2);
}
input:focus { box-shadow: inset 0 -5px 45px rgba(100,100,100,0.4), 0 1px 1px rgba(255,255,255,0.2); }

【问题讨论】:

  • 您可以考虑尝试在浏览器的 CSS 编辑器视图中对其进行调试。例如。在 Firefox 中,您可以按 F12 键转到开发人员工具,在那里您可以看到浏览器提供的所有元素的所有样式
  • @GrosLalo 我检查了编辑器视图中的 CSS 样式元素,由于某种原因,它没有做出与我对 css 文件所做的相同的更改。例如,它没有应用背景图像:无背景颜色:#e6e6e6 你知道我可以做些什么来确保这些更改适用吗?提前致谢

标签: javascript html jquery css flask


【解决方案1】:

您可以尝试添加 !important 以覆盖模板的背景。它看起来像这样

background-image:none !important;
background-color: #e6e6e6 !important;

【讨论】:

  • 我在正文中添加了 !important,正如您所概述的,但它并没有改变渐变背景。
  • 如果这不起作用,您应该尝试 background: none #color
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-12-12
  • 1970-01-01
  • 1970-01-01
  • 2021-05-25
相关资源
最近更新 更多