I'm trying to build a web site...

Joined
Oct 22, 2008
Messages
14
Reaction score
0
Points
1
Your Mac's Specs
Mac OS X version 10.6.8
Hi,
I'm learning html so I can build a website, I've read Creating Web Pages For Dummies so I've access to codes etc. I'm trying to set a background image but I can't find the code to make the writing appear on top of the image.

I'd also need to change the colour of the font as the image I'd like to use is mainly black.

Can anyone help at all?

Many thanks, James
 
Joined
Jan 29, 2008
Messages
703
Reaction score
9
Points
18
Location
Mendocino, CA
Writing should appear on top of the image by default. You said the image was mainly black, so it might just be very difficult to see the text. If you're learning HTML and not XHTML, you can use the font tag to change the font color and whatnot. Example:
Code:
<font color="white">White text!</font>
 
OP
J
Joined
Oct 22, 2008
Messages
14
Reaction score
0
Points
1
Your Mac's Specs
Mac OS X version 10.6.8
Hi,
Thanks, I've used that code to change the font colour, but the words just go around the image (depending on how the image is aligned of course).

This is the code I'm using;

<IMG SRC=url ALT="text">

Is this the correct code? Or does it differ when you want writing over the image?

Also, the image won't go exactly the left or top edge of the screen, no matter how I re-size or align it, leaving a thin white unwanted 'border'. Can anyone help with this at all?

Thanks very much for your help:)
 
Joined
Jun 18, 2006
Messages
191
Reaction score
5
Points
18
Location
Minneapolis
Your Mac's Specs
MacBook Pro
The tag you have is for a page image not for a background image. Do a search for html background image and you will find numerous different ways to accomplish what you need. As for the border add border="0" to the tag.
Here is a great place to start learning W3Schools Online Web Tutorials
 
Joined
May 21, 2007
Messages
198
Reaction score
5
Points
18
Your Mac's Specs
15" Macbook Pro, 2.16gz, 2gb RAM || 20" iMac, 2.4gz, 2gb RAM
<script type = "text/css">
body
{
background: url(/images/your_image.jpg);
}
</script>

Putting that code in the <head> tags of your code (and obviously ammending the image location) should sort you out..

I always have my CSS stored in an external file.. But youll do better learning about this stuff than me telling you how to do it.

Might also wanna look into repeats etc..
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top