Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Text over an Image
(1 viewing) (1) Guest
All your queries regarding CSS will be solved in this forum
  • Page:
  • 1
TOPIC:

Text over an Image

Text over an Image 1 year, 9 months ago #177

  • andrew
  • OFFLINE
  • Junior Boarder
  • Posts: 22
  • Karma: 0
Hi,

Is it possible to place text over an image and how?

Thanks in advance..

Re:Text over an Image 1 year, 9 months ago #179

  • abott
  • OFFLINE
  • Junior Boarder
  • Posts: 25
  • Karma: 0
To place text over an image you use the position property.
The below example illustrate how to achieve.
All you have to do is change the units as desired.

Example:
<div style="position: relative; width: 200px; height: 100px">
<div style="position: absolute; top: 0; left: 0; width: 200px">
<image>
</div>
<div style="position: absolute; top: 20%; left: 20%; width: 200px">
Text on Image
</div>
</div>
  • Page:
  • 1
Time to create page: 4.14 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download