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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:17:15+00:00 2026-06-06T05:17:15+00:00

I have a <input /> field and an <a><img /></a> icon which I want

  • 0

I have a <input /> field and an <a><img /></a> icon which I want to put inside the input.

Of course I can’t put an image inside of the input since it’s not that kind of tag, but I’d be happy with it just overlapping.

If I use position: relative (which makes positioning it correctly easy) the icon continues to take up invisible space where it would have been.

If I use position: absolute I cannot position the icon relative to its previous sibling, the positioning values are in relation to the parent, which is not great because different browsers render the <input> with different sizes.

Is there a workaround for this?

  • 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-06T05:17:17+00:00Added an answer on June 6, 2026 at 5:17 am

    http://jsfiddle.net/iambriansreed/u7DUv/

    Wrap the input and a in a wrapper and absolutely position the a off the relatively positioned div wrapper.

    CSS

    input {
        font-size: 24px;
        width: 200px;
    }
    div { 
        position: relative;
        width: 200px;
    }
    div a {
        display: block;
        position: absolute;
        top: 4px;
        right: 0;
        z-index:99;
    }   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an input field which I want to restrict so that the user
I have a 50x50 image and an <input type=text /> field that I want
I have an input field which is disabled or not based on its contents.
I have an input field which has a placeholder text. I want one word
I have a field where the user can input text and I want them
I have a input field where users can write a domain name that they
I have an input field on my webpage that I would like to allow
I have an input field that is by default set to type=text so that
I have an input field and I want to limit it to alphanumerical (A-Z,
I have an input field in a form. Upon pushing submit, I want to

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.