如何把文字放在HTML图像上? [英] How to put text over images in html?

查看:81
本文介绍了如何把文字放在HTML图像上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将文字放在HTML中的图片上。每次我输入下面的代码时,文本都会显示在图像下。

 < img src =example.jpg>文字< / IMG> 


解决方案

您需要使用绝对定位的CSS定位 img 标记。文章文字块通过图片给出了一个分步示例图片上的文字。

How to put text over images in HTML. Everytime I enter the below code, the text goes under the image.

<img src="example.jpg">Text</img>

解决方案

You need to use absolutely-positioned CSS over a relatively-positioned img tag. The article Text Blocks Over Image gives a step-by-step example for placing text over an image.

这篇关于如何把文字放在HTML图像上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆