2017-04-23 70 views
0

我想這在CSS,但它並沒有幹活也嘗試了照片保存在 我的電腦如何在ace編輯器中更改背景圖片?

.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 { 背景圖像:網址( 「https://s-media-cache-ak0.pinimg.com/564x/1c/da/05/1cda057bcd14d46c68e3051dc26f6850.jpg」); }

編輯: 我嘗試了工作url.Same問題,如果你申請改正選擇

+0

您的網址是不是工作? –

+0

https://jsfiddle.net/dalinhuang/c0wdg27h/ –

+0

@DanielH我試了另一個。 –

回答

0

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>

+0

你先生,是個天才!謝謝sooo多!我從來沒有想過容器的方法!謝謝 :) –