Placing a text over an image |
Placing a text over an image |
The_webmaster |
Jun 18 2021, 11:09 AM
Post
#1
|
Member Group: Members Posts: 40 Joined: 5-February 21 Member No.: 27,773 |
Please i need help. I want to place a text over an image, I have this but it didnt work:
CODE <style>.cover{position:relative;color:#000000;}.text{position:absolute;left:8px;top:18px;}</style> I know this can be done with css but the image don't show fully on css. Thanks for your reply<div class="cover"><img src="/cover-bg.jpg"><div class="text">Text over an image</div></div> |
Christian J |
Jun 18 2021, 02:02 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,650 Joined: 10-August 06 Member No.: 7 |
That should work. What did you mean with "the image don't show fully on css"?
|
The_webmaster |
Jun 18 2021, 02:34 PM
Post
#3
|
Member Group: Members Posts: 40 Joined: 5-February 21 Member No.: 27,773 |
I tryed using the image as a background in css, it only shows half of the image but covers the background which i set it to do so. Please can you show me a demo of the code i posted above ?
|
pandy |
Jun 18 2021, 03:03 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
Just use the example you posted yourself, where the image is an inline image.
If you want to use it as a background image you need to size the box so the whole image shows. But you should use the method that's most correct. If the image can be seen as content, something your visitors would want to see, is useful in some way, use an inline image. If it's just fluff, meaningless decoration, you can as well use a background image. |
The_webmaster |
Jun 18 2021, 04:14 PM
Post
#5
|
Member Group: Members Posts: 40 Joined: 5-February 21 Member No.: 27,773 |
Thanks for your reply, i tryed it again and it worked well, maybe i did'nt get it previously when it was not working. Thanks you very much
|
Lo-Fi Version | Time is now: 18th April 2024 - 07:07 AM |