Welcome to Dream.In.Code
Become an Expert!

Join 149,593 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,854 people online right now. Registration is fast and FREE... Join Now!




Adding text over image with html

 
Reply to this topicStart new topic

Adding text over image with html

clintmyster
3 Oct, 2007 - 05:17 AM
Post #1

New D.I.C Head
*

Joined: 1 Oct, 2007
Posts: 6


My Contributions
I have this image IPB Image and i want to add text directly on the image. I would like to do this in html so then the text is copyable. The text would just be like "title" and I do NOT want it to be an image. If you need further clarification to help me out, what i am exactly trying to do is located on this webpage which contains the same image. perfumewarehouse
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Adding Text Over Image With Html
3 Oct, 2007 - 05:21 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 9,482



Thanked: 161 times
Dream Kudos: 9050
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Set that image as the background for a Table Row (tr) or a TD, then put your text in the TD as you normally would.
User is offlineProfile CardPM
+Quote Post

EEE
RE: Adding Text Over Image With Html
9 Oct, 2007 - 08:06 AM
Post #3

New D.I.C Head
*

Joined: 16 Aug, 2007
Posts: 4


My Contributions
You could also use CSS (cascading style sheets) or the "style" attribute to set the z-index property of the <div> for the image at a lower number than the <div> containing the text.

For example
[code]
....
<div style="background-image:url(YourPicture.jpg);z-index:0"></div>
<div style="z-index:10">Your Text</div>
[code]
From what you are writing though, it sounds like you may want to have this same background image in multiple places on your page. You may want to use a CSS class.
[code]
....
<style>
.titleDiv {background-image:url(YourPicture.jpg)}
</style>
....
<div class="titleDiv">Your Text</div>
[code]

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 11:11PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month