Place text inside the image

0

Here is my code

 .imgs{
   position:absolute;
   margin-top: -180px; 
   margin-left: 25px; 
   width: 200px; 
   height: 200px;
    }
<td style="width: 200px;"><?php echo '<img width=200px; src="'.$imagens[$aleatorio].'"'; ?></td>
  <figcaption style="width: 200px;" class="imgs"><?php  echo $list; ?></figcaption>
  
  
  

    
asked by anonymous 25.07.2018 / 00:34

1 answer

0

You can use position: absolute; and change the text location with left , top , right and bottom

For too long texts you can use max-width and set the maximum size

span {
  position: absolute;
  left: 75px;
  top: 75px;
  color: white;
  max-width: 75px;
}
<div>
  <img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSG2SKL5FJaXqyHfvxrxb5NmQ4ZcWgCPyaZvqEB0qsSubAyQHOBkw">
  <span>texto muito largo para caber em uma linha</span>
</div>
    
25.07.2018 / 00:44