[英]How to change the background-image in 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");
}
.ace_identifier {background-image:url(“ https://s-media-cache-ak0.pinimg.com/564x/1c/da/05/1cda057bcd14d46c68e3051dc26f6850.jpg ”); }
编辑:我尝试了一个有效的URL。相同的问题
如果将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>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.