How can write text over images using CSS ?

Asked By 10 points N/A Posted on -
qa-featured

Hi everyone ,

Is it possible to write text over images using CSS ?

If so , please can anyone guide me on how to do this?

SHARE
Answered By 0 points N/A #94528

How can write text over images using CSS ?

qa-featured

Yes,it is possible to write text over images using CSS.

Just use this html on your post:

<div class="image">
  <img alt="write some thing" src="yourimage.jpg" />
  <div class="text">
    <p>Write the text you want to write over image</p>
    <p>
Write more text if you want to write over image in next pragraph</p>
  </div>
</div>

Then use this CSS code:

.image {
position:relative;
float:center; /* chose your position,optional */
}
.image .text {
position:absolute;
top:12px; /* specify position */
left:15px;
width:200px; /* specify wide you like */

}
You can change the value as your wise.You have to use this css for one time only and html code
to every post.In this case all the image will display text as the same manner.If you want
to specify different style for different image,then use different CSS
code in inline.

Login/Register to Answer

Related Questions