I am currently writing a responsive page using HTML5 and CSS3, and in my HTML, I have a form. The form contains a table that responds and collapses when the page is compressed. The only problem I encountered is the select tag, which does not compress along with other form elements. Here is my HTML and CSS -
<tr> <td id="content">Email Address</td> <td><input type="text" name="name" id="name" class="form"></td> </tr> <tr> <td id="content">Password</td> <td><input type="password" name="name" id="name" class="form"></td> </tr> <tr> <td id="content">Confirm Password</td> <td><input type="password" name="name" id="name" class="form"></td> </tr> <tr> <td id="content">Security Question</td> <td> <select class="form"> <option value="#">--Select Question--</option> <option value="#">What Is Your Father Middle Name?</option> <option value="#">In What Town Did You Spend Most Of Your Youth?</option> <option value="#">What Was Your Best Friend Name When You Were A Child?</option> <option value="#">What Was Your Favorite Childhood Pet Name?</option> <option value="#">What Was The Name Of Your Favorite Food As A Child?</option> <option value="#">What Year Did You Graduate High School?</option> <option value="#">Who Was Your Childhood Hero?</option> </select> </td> </tr>
CSS:
table { width: 100%; border-collapse: collapse; } tr:nth-of-type(odd) { background-color:#fff; color: black; font-weight: bold; } td, th { padding: 6px; text-align: left !important; font-size:13px; } @media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) { table, thead, tbody, th, td, tr { display: block; } }
while text fields are collapsed, the select tag does not work. Please how to solve this?
source share