OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <style> |
| 4 .container { |
| 5 position: relative; |
| 6 height: 50px; |
| 7 background-color: gray; |
| 8 } |
| 9 |
| 10 .auto-width { |
| 11 position: absolute; |
| 12 left: 0; |
| 13 } |
| 14 |
| 15 .with-border-padding { |
| 16 border: 2px; |
| 17 padding: 5px; |
| 18 } |
| 19 |
| 20 .border-box { |
| 21 box-sizing: border-box; |
| 22 -moz-box-sizing: border-box; |
| 23 width: 200px; |
| 24 height: 20px; |
| 25 } |
| 26 </style> |
| 27 </head> |
| 28 <body> |
| 29 <div>Check if the elements shrink to fit as per their 'intrinsic' width for Butt
on, input, select and textarea. If you see any the elements strech to available
width, then the test has failed.</div> |
| 30 <div class="container"> |
| 31 <button id="button" class="auto-width">Button</button> |
| 32 </div> |
| 33 <div class="container"> |
| 34 <input id="inputText" type="text" class="auto-width"> |
| 35 </div> |
| 36 <div class="container"> |
| 37 <select id="select" class="auto-width"></select> |
| 38 </div> |
| 39 <div class="container"> |
| 40 <textarea id="textarea" class="auto-width">Text area</textarea> |
| 41 </div> |
| 42 <div class="container"> |
| 43 <button id="buttonBorderPadding" class="auto-width with-border-padding">Button</
button> |
| 44 </div> |
| 45 <div class="container"> |
| 46 <input id="inputTextBorderPadding" type="text" class="auto-width with-border-pad
ding"> |
| 47 </div> |
| 48 <div class="container"> |
| 49 <select id="selectBorderPadding" class="auto-width with-border-padding"></select
> |
| 50 </div> |
| 51 <div class="container"> |
| 52 <textarea id="textareaBorderPadding" class="auto-width with-border-padding">Text
area</textarea> |
| 53 </div> |
| 54 <div class="container"> |
| 55 <button id="button-border-box" class="auto-width border-box with-border-padding"
>Button</button> |
| 56 </div> |
| 57 <div class="container"> |
| 58 <input id="inputText-border-box" type="text" class="auto-width border-box with-b
order-padding"> |
| 59 </div> |
| 60 <div class="container"> |
| 61 <select id="select-border-box" class="auto-width border-box with-border-padding"
></select> |
| 62 </div> |
| 63 <div class="container"> |
| 64 <textarea id="textarea-border-box" class="auto-width border-box with-border-padd
ing">Text area</textarea> |
| 65 </div> |
| 66 </body> |
| 67 </html> |
OLD | NEW |