CSS3
CSS 图片
尝试一下
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> .container { position: relative; } .topleft { position: absolute; top: 8px; left: 16px; font-size: 18px; } img { width: 100%; height: auto; opacity: 0.3; } </style> </head> <body> <h2>图片文本</h2> <p>在图片左上角添加文本信息:</p> <div class="container"> <img src="https://image-10001577.image.myqcloud.com/upload/3/20170417/14924148298151.jpg" alt="Norway" width="1000" height="300"> <div class="topleft">左上角</div> </div> </body> </html>
运行结果:
点击运行 »