Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS making an input box image clickable

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #42989
    pallavi1811
    Participant

    hi.. this is my html:

    this is my css:

    #name{
    background-color: #FFFFFF;
    background-image: url(“file:///Users/pallavi/Documents/workspace/PalCas/WebContent/images/forward_arrow.png”);
    background-position: 95% center;
    background-repeat: no-repeat;
    border: 1px solid grey;
    border-radius: 5px 5px 5px 5px;
    height: 30px;
    margin-left: 480px;
    margin-top: -180px;
    padding-left: 10px;
    width: 250px;
    }

    i want to click img

    background-image: url(“file:///Users/pallavi/Documents/workspace/PalCas/WebContent/images/forward_arrow.png”);

    and open a new html.

    how would i do that???

    Please reply asap.

    #126148
    Kitty Giraudel
    Participant

    I don’t understand, really.

    #126150
    Paulie_D
    Member

    You can’t click a background image.

    **Do you have a link?**

    If you want to go to a different page you have to use an anchor link and I’m guessing you don’t have one.

    https://css-tricks.com/how-to-ask-a-good-question-in-the-forums/

    #126151
    pallavi1811
    Participant

    this is an input box which has an arrow image. i want click arrow image.

    Is there any other way to do it.. any change in html or css can be done?

    #126152
    Paulie_D
    Member

    **WE NEED A LINK or A CODEPEN.**

    Frankly, I’m not sure what you are trying to do.

    What kind of input..there are several?

    #126153
    PicnicTutorials
    Participant

    Wrap the input in an anchor.

    #126154
    Paulie_D
    Member

    @websitecodetutorials

    I’m assuming that he wants the new page to be related to the contents of the input…so that probably won’t work.

    I’m feeling a jQ solution coming on. :)

    #126155
    Paulie_D
    Member
    #126156
    pallavi1811
    Participant

    yes right..the same discussion..

    if i wrap my input tag with an ‘a’ tag will it work?

    #126157
    Paulie_D
    Member

    Nope.

    You haven’t specified what it is you are trying to do.

    What relation does the contents of the input have to the link?

    #126158
    pallavi1811
    Participant

    see i have this textbox..

    inside this textbox i wanna write something and hit the image and it will go to next html.. hw can i achieve this?

    #126159
    Paulie_D
    Member

    Please specify what you mean by ‘next html’

    Do you mean a set page that won’t change?

    #126161
    pallavi1811
    Participant

    yes.. a static html.. like i can do:

    but in this case it is set as my background image for the textbox.. so hw to do for this particular case..

    #126163
    pallavi1811
    Participant

    sorry code dint come:
    yes.. a static html.. like i can do:

    #126165
    Paulie_D
    Member

    OK….as I said, you can’t click a background image but you can have a link with a background image.

    You have to have an anchor link in your HTML (ideally) and position it after the text area: http://codepen.io/Paulie-D/pen/yELfD

    We may not be able to style it as you were hoping but this will give you an idea.

Viewing 15 posts - 1 through 15 (of 20 total)
  • The forum ‘CSS’ is closed to new topics and replies.