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 938981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:43:05+00:00 2026-05-15T21:43:05+00:00

I can position a small background-image/icon 4 pixels from the center left of its

  • 0

I can position a small background-image/icon 4 pixels from the center left of its container with:

background: url(...) no-repeat 4px 50%;

How can I position it 4 pixels from the right?

  • 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-15T21:43:05+00:00Added an answer on May 15, 2026 at 9:43 pm

    Depending on your situation and what browsers you want to support, this works (tested on IE7-8, Firefox):

    background: url(...) no-repeat right 50%; border-right: 4px solid transparent;
    

    Of course, if you are already putting a border on the right, this will not help you at all.

    Added on edit: If the above doesn’t work because your are using the border, and you don’t care about IE7 (not sure we are quite at that point yet), and your “icon” width is known, then you could do:

    .yourContainer {
      position: relative;
    }
    
    .yourContainer:after {
      content: ' '; 
      display: block; 
      position: absolute; 
      top: 0; 
      bottom: 0; 
      right: 4px; 
      width: 10px; //icon width
      z-index: -1; //makes it act sort of like a background
      background: url(...) no-repeat right 50%;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

String image = JavaFXApplication9.class.getResource(splash.jpg).toExternalForm(); root.setStyle( -fx-background-image: url(' + image + '); -fx-background-position: center center;
If I use @import icon/*.png; @include all-icon-sprites; I can use background-position: sprite-position($icon, foobar); to
I can position a background image using the background property in an input field
The background-position property can be set in a variety of ways such as top
How can I get my background to act position: absolute; as my few div
I'm positioning a small image in the corner of the background of a div.
I toying with a project where I can position objects runtime on the screen.
I have imageView in activity. How I can set position this imageView in my
How I can get the position/Index of a substring within an NSString ? I
How I can get window position(xy) and size in extjs 4.

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.