Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 重写CSS内联CSS文件使用!重要的不起作用_Html_Css_Datepicker_Css Selectors - Fatal编程技术网

Html 重写CSS内联CSS文件使用!重要的不起作用

Html 重写CSS内联CSS文件使用!重要的不起作用,html,css,datepicker,css-selectors,Html,Css,Datepicker,Css Selectors,我在angular应用程序中使用了,并且提供了原始html。我想推翻这一点 如何使用css覆盖以下类的内联样式 <div class="selector selectorarrow selectorarrowleft" tabindex="0" ng-reflect-klass="selector" ng-reflect-ng-class="[object Object]" ng-reflect-ng-style="[object Object]" ng-reflect-value="1"

我在angular应用程序中使用了,并且提供了原始html。我想推翻这一点

如何使用css覆盖以下类的内联样式

<div class="selector selectorarrow selectorarrowleft" tabindex="0" ng-reflect-klass="selector" ng-reflect-ng-class="[object Object]" ng-reflect-ng-style="[object Object]" ng-reflect-value="1" style="width: 252px; height: 232px; top: 33px; left: 0px;"> ... 
尝试了以下操作但无效:

.selector.selectorarrow.selectorarrowleft[style] {
  position: relative !important
}

我会删除
[style]
并添加
div
,使其更加具体,如:

div.selector.selectorarrow.selectorarrowleft {
  position: relative !important;
  top: 10px !important;
}

你错过了一个分号!imporant@StefanBob在规则中省略最后一个分号实际上是可以的(尽管不是很好的做法)!此外,您不需要在选择器的末尾使用该[style]
.selector.selectorarrow.selectorarrowleft{}
应work@StefanBob在这种特殊情况下,属性选择器完全正常。如果说有什么区别的话,那就是增加了特异性。看看OP想要的是什么。@dirtyWold你所说的“预期输出”到底是什么意思?使用样式表不会向元素的
style
属性添加属性。(更改仅在浏览器的“检查”工具中可见。)
div.selector.selectorarrow.selectorarrowleft {
  position: relative !important;
  top: 10px !important;
}