Jump to content

Images


Imoddedu

Recommended Posts

I've ran this code through the validator MANY time and it seems fine. I think it has something to do with the alt attributes. Whenever I take them out the images are not visible (Only about and Work). Whenever I put in something for alt that is all it shows on the screen. Here is the code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml"><head><title>**************</title><meta name="Keywords" content="***********" /><meta name="Description" content="****************" /><meta http-equiv="Content-type" content="text/html;charset=UTF-8" /><link rel="stylesheet" type="text/css" href="style.css" /><script language="javascript" type="text/javascript">image1 = new Image();image1.src = "images/about.jpeg";image2 = new Image();image2.src = "images/work.jpeg";</script></head><body><img src="images/bg.png" width="100%" height="100%" id="bg" /><table align="center"><tr><td><img src="images/logo.png" alt="logo" /><br /></td></tr></table><div id="buttons"><center><a href="about.xhtml" onmouseover="image1.src='images/about2.jpeg';"onmouseout="image1.src='images/about.jpeg';"><img name="image1" src="images/about.jpeg" border="0" alt="About"/></a><a href="work.xhtml" onmouseover="image2.src='images/work2.jpeg';"onmouseout="image2.src='images/work.jpeg';"><img name="image2" src="images/work.jpeg" border="0" alt="Work"/></a></center></div></body></html>

Link to comment
Share on other sites

I don't understand the idea behind the JavaScript, cause it isn't doing anything...

Link to comment
Share on other sites

Nope, it isn't even being called, but I tried it with pictures I had (which were gif format, but that is neither here nor there, but that is all I changed) and it works perfectly. You can take out the script in any event.

Link to comment
Share on other sites

Guest FirefoxRocks

This is your Transitional XHTML but only more transition-ing-er...erm...cleaner:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml"><head><title>**************</title><meta name="Keywords" content="***********" /><meta name="Description" content="****************" /><meta http-equiv="Content-type" content="text/html;charset=UTF-8" /><link rel="stylesheet" type="text/css" href="style.css" /></head><body><div><img src="images/bg.png" alt="" style="width: 100%; height: 100%" id="bg" /></div><table><tr><td style='text-align: center'><img src="images/logo.png" alt="logo" /></td></tr></table><div id="buttons" style="text-align: center; margin: 0 auto"><a href="about.xhtml"><img name="image1" src="images/about.jpeg" border="0" alt="About" /></a><a href="work.xhtml"><img name="image2" src="images/work.jpeg" border="0" alt="Work" /></a></div></body></html>

I don't know how you got the page validated, it complains about the value of the width and height attributes of the bg image.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...