select-sizing-001.html (2090B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>Test for sizing of select elements, with wide vs. empty option selected</title> 6 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 7 <link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#list-box"> 8 <link rel="match" href="select-sizing-001-ref.html"> 9 <style> 10 select { 11 color: transparent; 12 margin: 1px; 13 } 14 div.customBorder > select { 15 /* This class is to let us test select elements *without* native theming 16 (for browsers that have both native and non-native controls): */ 17 border: 3px solid black; 18 } 19 </style> 20 </head> 21 <body> 22 <div> 23 <!-- Wide thing is 2nd, and not selected: --> 24 <select> 25 <option></option> 26 <option>some wide option</option> 27 </select> 28 <br> 29 <!-- Wide thing is 2nd, and selected: --> 30 <select> 31 <option></option> 32 <option selected>some wide option</option> 33 </select> 34 <br> 35 <!-- Wide thing is 1st, and selected (implicitly): --> 36 <select> 37 <option>some wide option</option> 38 <option></option> 39 </select> 40 <br> 41 <!-- Wide thing is 1st, and not selected: --> 42 <select> 43 <option>some wide option</option> 44 <option selected></option> 45 </select> 46 </div> 47 48 <!-- This is the same as above, but now with a custom border on the 49 select elements: --> 50 <div class="customBorder"> 51 <!-- Wide thing is 2nd, and not selected: --> 52 <select> 53 <option></option> 54 <option>some wide option</option> 55 </select> 56 <br> 57 <!-- Wide thing is 2nd, and selected: --> 58 <select> 59 <option></option> 60 <option selected>some wide option</option> 61 </select> 62 <br> 63 <!-- Wide thing is 1st, and selected (implicitly): --> 64 <select> 65 <option>some wide option</option> 66 <option></option> 67 </select> 68 <br> 69 <!-- Wide thing is 1st, and not selected: --> 70 <select> 71 <option>some wide option</option> 72 <option selected></option> 73 </select> 74 </div> 75 76 </body> 77 </html>