Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2010
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Trying to "combine" an image map with some CSS

    Hi there,

    In advance...thanks for your help!

    This is just a one-page thing that I should not be having such a hard time with. It's just one image on a page that is centered, and, when you click on one half of the image one site opens, and when you click on the other half, another site opens.

    Basically, I'm using CSS to successfully center said image (vertically and horizontally), and I'm using an HTML image map to successfully create the links I want on the page...but that means...there are 2 images! Seems like these 2 things should be combined somehow. I just don't know how. Unfortunately this is not live yet anywhere. But here's the code:

    <html xmlns="http://www.w3.org/1999/xhtml" lang="en-CA" xml:lang="EN-CA">

    <head>
    <title>Alexandra Schmidt</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta name="description" content="Alexandra Schmidt" />
    <meta name="keywords" content="Alexandra Schmidt, Alex Schmidt, 1248 Media, media consulting, journalism, NPR, online marketing, media consulting" />
    <meta name="author" content="Alex Schmidt" />

    <style type="text/css">

    body {
    background-image: url("main-img.png");
    background-attachment: fixed;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-color: #ffffff;
    }

    </style>
    </head>

    <img src="main-img.png" alt="alex-schmidt" usemap="#AS"/></A>

    <map name="AS">

    <area shape="rect"
    coords="53,97,251,173"
    target="_blank"
    href="http://www.1248media.com"
    alt="1248 Media"/>

    <area shape="rect"
    coords="291,198,402,266"
    target="_blank"
    href="http://alexandraschmidt.com"
    alt="Alex Schmidt"/>
    </map>
    </div>

    </html>

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Posts
    462
    Thanks
    0
    Thanked 20 Times in 20 Posts
    You're missing the begining div tag.
    <area shape="rect"
    coords="291,198,402,266"
    target="_blank"
    href="http://alexandraschmidt.com"
    alt="Alex Schmidt"/>
    </map>
    </div>

    Anyway if you only have two rectangle areas why use an image map...create the div using the background image and absolutely position two link tags within the container. Seems like that would be easier.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    For projects using MediaTypes (MIMETypes) visit E-BAM.net -(updated weekly)

    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.


  •  

    Posting Permissions

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