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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:28:41+00:00 2026-05-23T07:28:41+00:00

I want to place an image in a textbox which is left aligned with

  • 0

I want to place an image in a textbox which is left aligned with some padding-left value. For that i am using background-image and background-position properties in CSS.
Which image to place, is decided by a third value and the images are of different width.

My second requirement is the text in the textbox should be displayed after the image ends with a gap of 4px.
Because of varying image width the textbox width is also varying. i want to keep it at a fixed width.

I tried using text-indent property instead of padding-left by putting :

text-indent : 40px;

text-indent helps me keeping width fixed but when i click in the textbox it shows cursor at very start of the textbox(at 2px).

How can i do it? Which CSS properties should i use?

  • 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-23T07:28:42+00:00Added an answer on May 23, 2026 at 7:28 am

    I’m not completely sure of what your asking but from what I can gather it sounds like you need with CSS width property?

    .myInput
    {
       background: white url(images/smiley.png) center left no-repeat;
       padding-left:18px;
       width: 120px; /* Fixed outside bounds width of the text input*/
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to place links over a background image (set in CSS) and I
I want to place an image to the right of the view. For that
i have an image that i just want to place all the way at
I want to place image on the page which stays on the page bottom-right
Hi I want to place a Image which is center align vertically and horizontally
I have three rows which are configured programmatically. I want to place an image
I want to place a background-image after end of div bottom for a shadow
I'm using Nivo slider , but want to place a PNG image over the
I want that my background image stretch and scale depending on the browser viewport
Just finishing up my college project and I want to place a background image

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.