如何更改 ace 编辑器中的背景图像?

Abd*_*awy 3 html javascript css editor ace-editor

我在CSS中尝试过这个,但它不起作用。我还尝试了保存在我的计算机上的照片

.ace_identifier{
 background-image : url("https://www.google.com.eg/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0ahUKEwji1duTxbrTAhUEOBQKHamBCvQQjRwIBw&url=https%3A%2F%2Fox-fest.org%2F2017%2F02%2F06%2Fupcoming-workshop-coding-with-morgan-stanley%2F&psig=AFQjCNECub5OZqaxX9R684Gm4HLX-X7Zdw&ust=1493035590367032");
}
Run Code Online (Sandbox Code Playgroud)

.ace_identifier{ 背景图像 : url(" https://s-media-cache-ak0.pinimg.com/564x/1c/da/05/1cda057bcd14d46c68e3051dc26f6850.jpg "); }

编辑:我尝试了一个工作网址。同样的问题

a u*_*ser 5

如果您将 css 应用到正确的选择器,并确保没有规则覆盖它,则 css 应该可以工作。

<script src=http://ajaxorg.github.io/ace-builds/src-noconflict/ace.js></script>
<script>
var editor = ace.edit()
// set class to editor to use in css,
// could use .ace_editor too, but that
// would match all editors on the page
editor.container.classList.add("myEditor")
editor.setTheme("ace/theme/monokai")
editor.setValue("some text here", -1)
document.body.appendChild(editor.container)
</script>

<style>
.myEditor {
  position: fixed;
  left: 0; right: 0; bottom: 0; top: 0;  
  background :  url(https://s-media-cache-ak0.pinimg.com/564x/1c/da/05/1cda057bcd14d46c68e3051dc26f6850.jpg);
}
}

</style>
Run Code Online (Sandbox Code Playgroud)