Solution:
WordPress’ PHP constant WP_PLUGIN_URL
contains the absolute URL to your plugins folder. So, to get the url, use WP_PLUGIN_URL . '/myplugin/images/test.png'
. In the stylesheet, image paths are always relative to the stylesheet itself. using
.test { background: url(images/test.png); }
should work, as long as it’s in an external stylesheet. If it’s inline, you should use the absolute URL.