How to use relative path for images?


(BIlly) #1

I put some code inside a rectangle as I wanted an image to be inline with some text:

Some text with an image <div hypeattributeleft="85px" hypeattributetop="65px" style="pointer-events: auto; -webkit-transform: translateX(5px) translateY(5px) rotateY(0deg); height: 19px; overflow: visible; width: 19px; background-image: url(*need relative path*/X.png); -webkit-background-size: 100%; z-index: 5; background-repeat: no-repeat no-repeat; display:inline-block; margin-right:6px;"></div> here.

Ive had to put an absolute path for the image url which is not ideal. Is there not a way for it to be relative so it be called from root of the hype resources folder?


(BIlly) #3

Used this in the end:

background-image: url('${resourcesFolderName}/O.png')

Note: Capitals important!


(Mark Hunte) #4

Lol.

That was my answer. But stuck on hype 2.5 at the mo. and it was not playing ball !! so withdrew it :wink:


(BIlly) #5

Yeh I saw your answer but it didn’t work until I capitalised the foldername part. Cheers for pointing me in right direction though! :smile:


(Mark Hunte) #6

Ahh. That will teach me for copying and pasting. did not notice it was not camel humped as it was supposed to be .

Oh mine was in my answer. So not sure what thats all about

:thumbsup: