How to set image Position in CSS? - Tryit Editor for Web Developers
Edit This Code:
See Result »
<html> <head> <style> .container { position: relative; } .topleft { position: absolute; top: 8px; left: 16px; font-size: 18px; } img { width: 100%; height: auto; opacity: 0.5; } </style> </head> <body> <h2>Image in the Top left corner:</h2> <p><b>How to position text over an image:</b></p> <div class="container"> <img src="logo.jpg" alt="logo" width="2000" height="400"> <div class="topleft">T4-Tutorials</div> </div> </body> </html>
Result: