Hi, i have an image in css like background-image:url("..//safakjfa.jpg"). I want to add image with xslt. I searched a lot in internet,i found something but they didn't work. I added this image in html code like <img src="asfas.jpg" but template is break or i added image <img style="background-image:url("..//sdlkalkf.jpg")" but this didn't work also. How do you help me about this topic?
Then the home Image div will get a background image, In XSLT you can´t have an empty div, so if you don´t need to have a text in there you need to use e.g a non-breaking-space so the div tag is not empty.
Another way that you could do it is by doing something like this.
Using xslt for Image in css
Hi, i have an image in css like background-image:url("..//safakjfa.jpg"). I want to add image with xslt. I searched a lot in internet,i found something but they didn't work. I added this image in html code like <img src="asfas.jpg" but template is break or i added image <img style="background-image:url("..//sdlkalkf.jpg")" but this didn't work also. How do you help me about this topic?
Hi Abdulmenaf and welcome to our.
One way that you could do it is by this:
Then the home Image div will get a background image, In XSLT you can´t have an empty div, so if you don´t need to have a text in there you need to use e.g a non-breaking-space so the div tag is not empty.
Another way that you could do it is by doing something like this.
Since you are new to Umbraco I would like to include some documentation on what CurrentPage is http://our.umbraco.org/wiki/reference/xslt/understanding-currentpage
In my exmple I have a field on the documenttype with an alias of backgroundImage.
Hope this helps,
/Dennis
Finally it's done. Thank you so much. Both work.
is working on a reply...