Shaliza
07-30-2007, 07:14 PM
Not sure what's wrong with my head. I just blanked out on it. Tried searching & nothing came up really.
![]() | View Full Version : Somehow, I've forgotten how to put a text over graphic Shaliza 07-30-2007, 07:14 PM Not sure what's wrong with my head. I just blanked out on it. Tried searching & nothing came up really. SoftWareRevue 07-30-2007, 07:38 PM What are you talking about? Actual text on the graphic? Or text when the mouse hovers like, "title="Something to say here?" Shaliza 07-30-2007, 07:50 PM I mean actual text on the graphic. No mouseover. Jay August 07-30-2007, 08:20 PM you have to move the image to the background of its parent, let's say a div or table, and then you can put text over it. <div style="background: url(images/bla.gif)"> <p>bla bla bla bla</p> </div> Paul-M 07-30-2007, 08:48 PM Or, you could use CSS also: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Title</title> <style type="text/css"> <!-- #text_on_image { background: transparent url(www.domain.com/image.jpg); } --> </style> </head> <body> <div id="text_on_image">This text is on top of my image... Creepy, right?</div> </body> </html> Showing the full document for what you want to do ;)! Shaliza 08-01-2007, 02:14 AM I knew it was that easy. Thanks to you both. Shaliza 08-11-2007, 09:03 AM I never had the chance to test it that day, but it looks like I'm stuck again. The first method almost worked, except for the fact that it only showed some of the top image. The rest of it wasn't there. I checked my image & it's fine, so it must be the code. And I can't use the second method given because I'm using a CMS & it requires the style to be in the header [I'd have to create a very large number of sections in order for this to work.] Hard to do when there are going to be different images. Does anyone have any ideas? converge 08-11-2007, 07:32 PM Paste a bit of the code (image + what text you want) or else image dimensions, so that proper formatted css code can be provided.. Cheers.. Jack Shaliza 08-12-2007, 07:25 AM This code is actually a test, but I'm trying to put the post method onto the picture - you see the blank spot at the top-right of the picture? There. <center> <div style="background: url(gear.tycp.com/images/tees/tee.png)"> <br><br> <FORM METHOD="POST" ACTION="http://www.aitsafe.com/cf/add.cfm"> <INPUT TYPE="HIDDEN" NAME="userid" VALUE="gg12345"> <INPUT TYPE="HIDDEN" NAME="product" VALUE="North Atlantic Marine Chart"> <INPUT TYPE="HIDDEN" NAME="price" VALUE="29.50"> <select name=product size=1> <option selected>Navy Blue></option> <option>Racing Red></option> <option>Yellow></option> </select> <input name=submit type=submit value="BUY IT NOW!"></FORM> </center></div> killapix 08-12-2007, 03:40 PM 1. Center tag is depreciated use css to center that div.? 2. Closing tags are wrong way around <center> opened first and should be last to close: </div></center>. 3. Also try giving the <div> an id or class and put the background style into the stylesheet, should make the code a bit neater. Also will give you the opportunity to add paddings and margins etc if needed. Shaliza 08-13-2007, 08:27 PM An id class like the code Paul provided? That won't work because I'm using a CMS. Like I said above, I'd have to create many sections. killapix 08-14-2007, 09:04 AM Does the CMS not use an external stylesheet already.? Shaliza 08-15-2007, 04:00 AM Nope. I had to make my own, but I'm still trying to figure this out. killapix 08-15-2007, 11:37 AM You had to make your own css stylesheet or your own CMS.?? This is getting quite difficult as I need more info on what and how you are trying to achieve this try and give me more info on what you working with.? PHP.? Shaliza 08-15-2007, 08:20 PM My own stylesheet.] And yeah, I'm working with PHP. What I'm trying to do is figure out why only part of the image is showing. The rest of it seems to somehow be hidden. killapix 08-16-2007, 01:47 AM Have you set the height and width in the style.? So are your pages using includes like header.inc.html or header.php and footer.php.? and what file are you working on.? Index.php.? Can you show me the code for the page you are working on.? |