No title

 How to add text on  image: 

  1. You need to create a parent with relative position.
  2. Then Add your image and text.
  3. Give the text layer the basic style and add position absolute and top,left,right,bottom value relative to where you need the text to appear.
  4. Give width 100% for the text layer to cover full width as your relative parent.

Code

  1. <!-- HTML -->

  2. <div class="relative">

  3. <img src="image-path" alt="">

  4. <p class="absolute-text">Hey I am text on an Image.</a> </p>

  5. </div>

  6. /* CSS */

  7. .relative{position:relative; width:600px;}

  8. .absolute-text{position:absolute; bottom:0; font-size:24px; font-family:"vedana"; background:rgba(251,251,251,0.5);

  9. padding:10px 20px; width:100%; text-align:center;}

  10. .absolute-text a{font-size:16px; color:#b92b27;}


1 Comments

  1. Hi.. This information is really works to write a text on image.

    ReplyDelete
Previous Post Next Post