javascript - 带有angularjs的css中奇怪的渐变行为

标签 javascript html angularjs css

<分区>

这是我使用的CSS

html .body-dark{
  background: #242A3F;
  background: -webkit-linear-gradient(left top, #242A3F, #333C55);
  background: -o-linear-gradient(bottom right, #242A3F, #333C55);
  background: -moz-linear-gradient(bottom right, #242A3F, #333C55);
  background: linear-gradient(to bottom right, #242A3F, #333C55);
  background: -moz-linear-gradient(-90deg, red, yellow);
}

与 Jade 有关

doctype
html.no-js
  head
    meta(charset='utf-8')
    meta(http-equiv='X-UA-Compatible', content='IE=edge')
    base(href='/')
    title Travel
    meta(name='description', content='')
    meta(name='viewport', content='width=device-width, initial-scale=1')
    link(rel='stylesheet',href='main.css',async)
  body.body-dark(ng-app='application')
    div(ng-view)
    <!-- build:js inline app.min.js -->
    script(src='app.min.js')
    <!-- /build -->
    script(src='//localhost:35729/livereload.js')

正如您所看到的,渐变类附加到主体上,我假设应该只有一个渐变。但另一方面,这是我得到的输出 Wrong gradient picture

另一个重要信息可能是页面由两个组件组成,nav 模板和 form 模板都使用 ng-include< 调用 虽然我不确定错误是否是因为那个。 这里还有一份来自浏览器的 DOM 副本

enter image description here

如您所见,正文仅在表单结束之前出现,我如何才能将其扩展到整个页面。还有为什么下面有两个渐变元素?

最佳答案

设置

html, body, .body-dark{
  background: #242A3F;
  background: -webkit-linear-gradient(left top, #242A3F, #333C55);
  background: -o-linear-gradient(bottom right, #242A3F, #333C55);
  background: -moz-linear-gradient(bottom right, #242A3F, #333C55);
  background: linear-gradient(to bottom right, #242A3F, #333C55);
  background: -moz-linear-gradient(-90deg, red, yellow);
  height: 100%;
}

关于javascript - 带有angularjs的css中奇怪的渐变行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41714876/

上一篇:html - 如何为两列保持单个 div 和相同的高度

下一篇:javascript - 滚动时触摸的 CSS 或 Javascript 事件

相关文章:

javascript - jQuery.extend() 和 jQuery.fn.extend() 是相同的......对吗?

javascript - "Object doesn' t support property or method 'find' "in IE11 with Babel and Webpack

javascript - knockout JS : Show message when the returned array is empty

html - 如何将工具提示定位在光标上方

javascript - 尝试制作 Canvas "jump"

css - 如何定位 div 使得 <p> 标签不会破坏位置?

javascript - angularjs 模板绑定(bind)

angularjs - 在解决值之前如何防止状态更改

AngularJS、Jasmine 和 $ressource = promise 未解决

javascript - 为什么我可以删除一个声明为 a = 1 的变量而不是一个在 javascript 中声明为 var b = 1 的变量