The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Placing a text over an image
The_webmaster
post 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>
<div class="cover"><img src="/cover-bg.jpg"><div class="text">Text over an image</div></div>
I know this can be done with css but the image don't show fully on css. Thanks for your reply
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jun 18 2021, 02:02 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



That should work. What did you mean with "the image don't show fully on css"?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_webmaster
post 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 ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 18 2021, 03:03 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_webmaster
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 07:33 AM