Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4247598
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:07:45+00:00 2026-05-21T04:07:45+00:00

I have an image with id myimage . It has a width of 300px

  • 0

I have an image with id myimage. It has a width of 300px and height 100px. each 100px wide portion has a unique color, like below

------------------------
| red  | green | blue  |
------------------------

Is it possible to use each portion (having width & height 100px) with different id so that the image can be used as a button with different functions to each portion??

Answer only if it is possible and comment for others.

thanks in advance…:)
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T04:07:45+00:00Added an answer on May 21, 2026 at 4:07 am

    Set your image as a background image and give the parent div position:relative property. Then use nested divs with position:absolute each 100px apart from one another.

    <div id="wrap">
        <div class="first"></div>
        <div class="second"></div>
        <div class="third"></div>
    </div>
    
    #wrap{
        background:transparent url(...) no-repeat 0 0;
        width:300px;
        height:100px;
        position:relative;
    }
    
    .first, .second, .third{
        position:absolute;
        top:0;
        width:100px;
        height:100px;
    }
    .first{
        left:0;
    }
    .second{
        left:100px;
    }
    .third{
        left:200px;
    }
    

    Now using JQuery you can reference each part individually.

    $('.first').click(function(){ // this is the first part
     alert('first clicked')
    })
    

    Check working example at http://jsfiddle.net/PrMzr/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have an image that has a width of 2000px. The snazzy design
What I am trying to do is something like this: I have my image
From times to times I have to know the width and height of images.
I have a custom UIImageView class that creates thumbnails (UIImageView) and each thumbnail has
I have an image over a table that has been style with CSS. When
I have a block of text that has a particular image that I want
I have a DOM structure which looks something like below - <div id='MyDiv'> <span>Hello
I have a slider on my page that has a height of 200px and
I have a div that has a footer image taking up 26px of space.
I have a number of images within #mycontainer like: <div id=mycontainer> <img src=http://localhost:8080/images/my-image.png />

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.