Solved

position text precisely on top of an image

Posted on 2011-03-01
3
198 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

831 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