www.webdeveloper.com
Results 1 to 4 of 4

Thread: Set the background image for dropdown

  1. #1
    Join Date
    Sep 2012
    Posts
    4

    Set the background image for dropdown

    hi i want to set the background image for dropdown in html without jquery

  2. #2
    Join Date
    Sep 2012
    Posts
    2
    hi,

    You can add background image to its submenu's css property like this

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>

    <body>
    <style>
    ul > li > ul{ background-image:url("image path");}
    </style>
    <ul>
    <li><a href="#">menu</a>
    <ul>
    <li><a href="#">submenu</a></li>
    </ul>

    </li>
    </ul>
    </body>
    </html>

  3. #3
    Join Date
    Sep 2012
    Posts
    4

    background for dropdown

    Thanks for your reply ashish,

    i want to set the background for select tag in html
    <select ><option value="list1">List1</option>
    <option value="list2">List2</option>
    <option value="list1">List1</option>
    </select

  4. #4
    Join Date
    Sep 2012
    Posts
    5
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    body {
    background: #d00;
    }
    select {
    background: rgba(255,255,255,0.1) url('http://www.google.com/images/srpr/nav_logo6g.png') repeat-x 0 0;
    padding:4px;
    line-height: 21px;
    border: 1px solid #fff;
    }
    </style>
    </head>
    <body>
    <select>
    <option>Foo</option>
    <option>Bar</option>
    <option>Something longer</option>
    </body>
    </html>



    Android Application

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles