且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用HTML / Javascript / CSS动态添加文本到图像上?

更新时间:2023-11-01 18:59:46

你可以绝对定位文本。一旦图像加载,即使随机,jQuery的position()方法将提供您将需要的所有信息。

you can position text absolutely. once images are loaded, even if randomly, jQuery's position() method will provide you will all the information you need.

显然,您希望将图片封装在容器中。或使用和设置图像使用div的背景图像。那么你可以***地将任何你想要的文本/效果放在容器中。

obviously, you would like to to encapsulate images in containers e.g. or use and set image using div's background image. then you have all the freedom to put whatever text/effects you want in the container.