Solved

position text precisely on top of an image

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax Error 2 47
Download a website to hdd 2 52
Centering Vertically 3 28
css icomoons will not display on page 14 22
When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
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 Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

863 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

21 Experts available now in Live!

Get 1:1 Help Now