PDA

View Full Version : Text on top of image?



WhoCares357
03-31-2008, 11:03 PM
I'm trying to use a div tag to center an image and put text on top of it. But I don't know how to place the text over the image. Anyone have any ideas? Kinda new to this.

1337.
04-05-2008, 06:49 PM
Off the top of my head you should be able to do something like:



<p>
<span style="background:url('image.gif');" />
Text over Image
</p>

NiCbaZ
04-06-2008, 03:58 AM
are you useing dream weaver? if you are set the image as the backgroud to the table and just type over it.

Dumpin
04-06-2008, 08:41 AM
It's correct what L33t is saying.. this is a part of my photoshop layout:

<td colspan="9" rowspan="7" valign="top"

background="images/index_22.gif">
<p>
<?php
$menu = $_GET['menu'];
$name = $_GET['name'];
//$info = $menu ."/" . $name . ".txt";
$info = "./" . $menu . "/" . $name . ".txt";
$content = @file_get_contents($info);

if(empty($content) || empty($name)){
$content = @file_get_contents('1/Home');
}
echo $content;
?>
</p>


</td>


Edit: the red is php which doesn't have to bother you

WhoCares357
04-06-2008, 12:58 PM
Thanks guys. Gonna go try it out.

PS I am using Dreamweaver.

Jagex_Fagex
04-28-2008, 06:52 AM
editing the code, you should be able to add a background property to the div tag:

<div background="location/file.gif>

kinda thing.. then in the div itself have the text. Although i don't know much about the div tag. You can use it in the table tag. so try it out.

Daniel
05-02-2008, 06:23 AM
Are you sure he wants the image a background?

NiCbaZ
05-03-2008, 04:01 AM
if you want text on it thats the only was in dream weaver

Jagex_Fagex
05-18-2008, 05:11 AM
http://www.tizag.com/cssT/layers.php

also try there. you can do it with CSS

WhoCares357
05-19-2008, 01:32 AM
I was looking this over for a while now and I think that the best way is to use a table (divide the banner, buttons, etc).

hylian_loach
05-19-2008, 09:55 AM
1337's method is the best way - use CSS to create a background image within an element and position the text over the element.

1337.
06-11-2008, 09:10 PM
Yeah, tables are very outdated for that sort of thing (due to accessibility reasons). Try to pick up a bit of css and find a workaround with div's/span's ;)