Applying background-image to <SELECT> element

Posted on 2006-06-01
Last Modified: 2011-08-18
Hi experts

Looking for a quick answer...

Anyone know how to make this work?

my code:

<select name="cboTest" id="cboTest">  
<option value="1" style="background-image: url(./_img/plus.gif);" selected>    one  </option>
<option value="2" style="background-image: url(./_img/minus.gif);">    two  </option>  

Alan ";0)

ps... Code works fine in firefox, but not in IE 7
Question by:Alan Warren
    LVL 18

    Expert Comment

    Have you tried messing with:

    background-repeat: no-repeat;
    background-position: 1px 2px;


    The shorthand css is:

    background: url(.jpg) no-repeat 1px 2px;
    LVL 10

    Accepted Solution

    LVL 30

    Expert Comment

    > I really don't think going to such lengths is worth the effort at all. It's a form control, for goodness sake.
    I most definitely agree!

    You can use radio buttons instead... but i guess you know that already.
    LVL 26

    Author Comment

    by:Alan Warren
    Sorry for the delay.

    Finding out that there is no work around for IE, was the information I was looking for.


    Alan ";0)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
    In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now