Results 1 to 2 of 2

Thread: CSS Select Form Border Elimination in IE

  1. #1
    Join Date
    Nov 2010
    Posts
    28
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default CSS Select Form Border Elimination in IE

    I am trying to style a drop-down select box so that no border appears in all major browsers. By using the
    HTML Code:
    style="border:none;"
    I managed to remove the border in every major browser (Firefox, Chrome, Opera, and Safari), except IE, which, in my case, really makes it look lousy. Is there anyway to fix this? Thanks. Here's my code:
    HTML Code:
    <html>
    <head>
    
    <style type="text/css">
    
    div {
      background:#402020;
      width:150px;
      margin:0px;
      padding:5px;
      border:#202020;
      text-align:center;
    }
    
    select {
      background:#402020;
      border:none;
      margin:0px;
      padding:0px;
      font-family:comic sans ms;
      color:#e9e9e9;
      font-size:14px;
      width:60%;
    }
    
    </style>
    </head>
    
    <body>
    <div>
      <form>
        <select>
          <option>Option 1</option>
          <option>Option 2</option>
          <option>Option 3</option>
          <option>Option 4</option>
        </select>
      </form>
    </div>
    </body>
    </html>

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I believe you are stuck with that in IE 7 and less. However, if your document invokes standards compliance, IE 8 and presumably 9, etc. will respect it:

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    
    <style type="text/css">
    
    div {
      background:#402020;
      width:150px;
      margin:0px;
      padding:5px;
      border:#202020;
      text-align:center;
    }
    
    select {
      background:#402020;
      border:none;
      margin:0px;
      padding:0px;
      font-fami . . .
    The only alternative for those older IE browsers I can think of would be a custom select:

    http://www.google.com/search?hl=en&c...=&oq=&gs_rfai=

    But I wouldn't recommend any of that just to satisfy older IE. If you feel you must though (IE 7 may be around a bit yet in significant numbers) make the custom select code IE 7 and less only.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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