Results 1 to 2 of 2

Thread: cannot center image map on page

  1. #1
    Join Date
    Aug 2010
    Posts
    1

    cannot center image map on page

    I'm completely new to image maps and CSS and have recently placed an image map on my personal site. I want the image map to be the center of the page. I have it in a table as I've heard it's best to use tables throughout the site. The image map will not move to the center, but instead stays on the left side no matter what I do. I've done everything to my knowledge.

    Here's the code:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
      <script language="JavaScript">
    <!-- hide from none JavaScript Browsers
    Image1= new Image(960,640)
    Image1.src = "img_index.jpg"
    Image2 = new Image(960,640)
    Image2.src = "img_indexrollover.jpg"
    // End Hiding -->
      </script>
      <meta
     content="text/html; charset=ISO-8859-1"
     http-equiv="content-type">
      <title>Index</title>
    </head>
    <body
     style="color: rgb(0, 0, 0); background-color: rgb(16, 0, 2);"
     align="center" alink="#000099" link="#000099"
     vlink="#990099">
    <table
     style="width: 960px; height: 640px; text-align: left; margin-left: auto; margin-right: auto;"
     border="0" cellpadding="0" cellspacing="0">
      <tbody>
        <tr align="center">
          <td
     style="text-align: center; vertical-align: top;" align="center"><img
     style="border: 0px solid ; width: 960px; height: 640px;" alt=""
     usemap="#Image-Maps_3201007132346352" src="img_index.jpg"
     id="a" align="middle"><map
     name="Image-Maps_3201007132346352"
     id="_Image-Maps_3201007132346352">
          <area title="indexmap"
     alt="Enter Site"
     onmouseout="document.getElementById('a').src = 'img_index.jpg'"
     onmouseover="document.getElementById('a').src ='img_indexrollover.jpg'"
     href="News.html" coords="8,31,568,146" shape="rect">
          </map>
          </td>
        </tr>
      </tbody>
    </table>
    </body>
    </html>

  2. #2
    Join Date
    Sep 2010
    Posts
    6
    see whn u wnt 2 place img at the center in img src tag specify vspace=" " and hspace=" " attributes

    see ths below example......

    <html>
    <body>

    <img src="angry.gif" alt="Angry face" width="32" height="32" align="bottom" hspace="250" vspace="100"/>


    </body>
    </html>

    so nw in u'r code specify vspace and hspace attributes in img src tag....


    Simpson.john54
    Couches Sectional

Similar Threads

  1. Automatically Load image on page load
    By scrader in forum Web Design, HTML Reference and CSS
    Replies: 1
    Last Post: 13 Mar 2010, 04:24 AM
  2. Help With Image Map With Rollovers and More
    By porphyrins in forum General Questions
    Replies: 1
    Last Post: 03 Dec 2008, 02:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •