css - 为什么我的样式对象的某些属性在 ng-style 中被忽略了?

标签 css angularjs

我的 Controller 中有这个样式对象:

p: {
  'font-family': 'Lucida Grande\', \'Lucida Sans Unicode\', Helvetica, Arial, Verdana, sans-serif',
  'margin': '0'
}

只有“边距”可用(在 Chrome 开发工具中,“边距”位于“元素”部分的“样式”列表中)。有人发现我指定的字体系列有问题吗?

最佳答案

试试这个:

'font-family': '\'Lucida Grande\', \'Lucida Sans Unicode\', Helvetica, Arial, Verdana, sans-serif',

这可能是因为您需要在 Lucida Grande 之前添加一个左撇号 ',目前那里的撇号不能满足这个目的。

关于css - 为什么我的样式对象的某些属性在 ng-style 中被忽略了?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18163592/

相关文章:

css - 响应式 div 小部件 Bokeh

javascript - 具有过滤/显示表格部分的代码。想知道如何将整个表格作为一个表格进行过滤吗?

javascript - 使用 angularjs 在 Controller 中注入(inject)服务

javascript - 参数 'PeopleController' 不是函数,未定义 IonicJS

html - 输入框填满可用空间?

html - 具有多个标识符的 css 类定义

css - 我的基于 CSS 的图像 slider 问题,从最后一张图片返回到第一张图片

angularjs - 如何在使用 AngularJS 保存变量的同时进行单元测试?

angularjs - 如何在我的 angularJs webApp 中使用 $routeProvider 而不是 $stateProvider?使用哪一个更好?

javascript - 删除表单元素时,AngularJS 验证不同步