Solved

position text precisely on top of an image

Posted on 2011-03-01
3
196 Views
Last Modified: 2012-06-27
How do I position some text precisely on top of an image? I don't want to use absolute positioning relative to the browser window, but positioning relative only to the image. So if the image moves, the text maintains its position within the image.
0
Comment
Question by:SweatCoder
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 35013797
try set the positioning of a block (div) as absolute, with the image as its background image and the text as its content
0
 
LVL 11

Author Comment

by:SweatCoder
ID: 35018292
How do I set a background image on a div? I want the div to be exactly the same size as the image so that the image entirely covers it.
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 35024296
<< How do I set a background image on a div? >>
you can set the background image of almost any element. please check
http://www.w3schools.com/css/css_background.asp

0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now