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

  • SEARCH
  • Home
  • 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 8310169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:21:46+00:00 2026-06-08T19:21:46+00:00

My background image having width:118px ,On clicking on background image i want to perform

  • 0

My background image having width:118px,On clicking on background image i want to perform some jquery, i cant use <a> tag.How to make cursor:pointer only on background and how to give a class name only for the background? Is it possible? how?

<div id="post1_img"></div>

    #post1_img
 {
    width:280px;
height:33px;
background:url(../images/assets/pullTab-readMore-off-.png) no-repeat top center;
clear:both;
  }

EDIT

enter image description here

clicking on read more i want to perform some action,Is it possible to do without creating any extra div

width of div:280px;

width of image:118px;

http://jsfiddle.net/prash/A8FWa/

  • 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-06-08T19:21:48+00:00Added an answer on June 8, 2026 at 7:21 pm

    you can put the background image as an background of a div which has the same dimension with the image. then place this div centered inside another div.

    <div id="outer">
      <div id="post1_img">
       </div>
    </div>
    
    //css
    #post1_img{
       width:70px;
       cursor:pointer;
       background:url(pullTab-readMore-off-.png) no-repeat top center;
       /*you need more css here to adjust this div to be center of the outer div*/
    }
    #outer{
       width:280px;
    }
    
    //jquery
    $('#post1_img').click(function(){
        //do something
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having an issue positioning a background image using the following jquery background
I'm having some trouble writing a correct algorithm for centering a background image. Here's
I'm having some issues while using a transparent PNG image as a background image
I am having trouble getting a background-image to overlay the border of another div.
I am having trouble displaying an background image in my ASP.NET MVC 2 application.
.myDiv { background-image: url(urltomyimgheader); height:100px; margin: auto; position:relative; top:-10px; width:600px; } This is a
I have this background image that is 175x175 but I am trying to make
I am having an issue where the background image is cutting off to the
I'm just trying to put a background image on a webpage with 100% width
I am having trouble getting my background image to span the entirety of my

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.