我想动态地将数字放在图像上。
2 回答
取两个div。为一个 div 设置背景图像并在另一个 div 上放置一些数字。使用 css 属性(如位置、z-index)将第二个 div 放在第一个 div 上
There are 2 ways of doing that:
1.) In the client-side: You can use the HTML5 CANVAS API. This API allows you to draw arbitrary shapes and images inside a canvas element that is rendered into the browser. So to solve your problem you could load an image inside the canvas and after that draw a number on top of it.
2.) In the server-side: You will load the image and after that draw the number inside of it using a server-side application. Eg. an application developed using PHP, ASP.NET, Python, etc. In PHP you can use the GD library to do that.