Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-16-2012, 04:36 AM   PM User | #1
ronuk99
New Coder

 
Join Date: Jun 2012
Posts: 19
Thanks: 5
Thanked 0 Times in 0 Posts
ronuk99 is an unknown quantity at this point
help needed overlay text from php onto image

hello im ron and this is my website for our online radio at www.vikingradio.net...after 6 months and following this site i am now really stuck with this one. You will see in the center of webpage a picture of our studio . i want to overlay our program schedule dynamically. Already done that part using ajax script kindly given to me. Now heres the html to bring up the image <img src="images/onnow.jpg" the timediv does a refresh to update the users online . My problem is i wish to overlay the text which would show in timediv onto the image . irealise i have two seperate divs which may be one of the problems.

my website is www.vikingradio.net to see the working. Only tested in chrome


<div id="content">
<script type="text/javascript">
refreshdiv_timediv();
</script>
<div id="ad3" style="position: relative;padding-bottom: 12px;"720" height="180"><div name="timediv" id="timediv"></div>
<img src="images/onnow.jpg" width=720 height=180 border="0" ">








</DIV>
ronuk99 is offline   Reply With Quote
Old 06-16-2012, 01:10 PM   PM User | #2
Will Bontrager
Regular Coder

 
Join Date: Jun 2012
Location: Near Chicago, USA
Posts: 123
Thanks: 7
Thanked 19 Times in 19 Posts
Will Bontrager is an unknown quantity at this point
Unfortunately, I am unable to code this for you. I had intended just a quick peek at the forum before getting on with something I need to do.

Perhaps this short how-to will help.

One way to overlay content on top of other content is with CSS position:absolute. Use the top:... and left:... to specify the position, which position the overlaid content the specified number of pixels from where they're measuring form.

Where they're measuring from is the key for accurate positioning. They will measure from the first container (like a div tag) with a CSS positioning style other than position:static. If none such is on the page, they will measure from the body tag.

Unless a person wants to specify position from the body tag, a container with a CSS position other than static needs to be specified. I generally use position:relative.

Here is an example of the concept:

Code:
<div style="position:relative;">

   <!-- image of studio -->

   <div style="position:absolute; top:3px; left:15px;">

      <!-- program schedule -->

   </div>

</div>
The top:3px of the position:absolute div positions the top of the div 3 pixels below the top of the position:relative div. And the left:15px positions the left of the position:absolute div 15 pixels from the left of the position:relative div.

For the position:absolute, bottom:... and right:... may be used instead of top:... and left:... if those would work better for you.

Hopefully, you can use the above to develop the code you need. Maybe others will find the concept helpful, also.

Will
__________________
Numerology API for apps - Facebook, iPad, mobile phones. No charge to use API. [info]
Will Bontrager is offline   Reply With Quote
Users who have thanked Will Bontrager for this post:
ronuk99 (06-16-2012)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:35 AM.


Advertisement
Log in to turn off these ads.