Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the input text wider

I trying to make the text bar wider but I cant get it to work. I have tried with width but it didn't work for me. I also couldn't find anything on the internet.

This is my HTML:

HTML:

<form action="" method="post">
<legend>Neem contact op</legend>
<table>
    <tr>
        <td>
            <label for="Naam">Naam: </label>
        </td>
        <td>
            <input type="text" id="Naam" name="Naam" placeholder="Naam" required="required" />
        </td> 
    </tr>
    <tr>
        <td>
            <label for="Email">Email :</label>
        </td>
        <td>
            <input type="email" id="Email"name="Email" placeholder="Email" required="required" />
        </td>
    </tr>
    <tr>
        <td>
            <label for="Seizoen">Seizoen: </label>
        </td>
        <td>
            <select name="Seizoen" id="Seizoen" required>
            <option value="">Kies hier je seizoen</option>
                <option value="Lente">Lente</option>
                <option value="Zomer">Zomer</option>
                <option value="Herfst">Herfst</option>
                <option value="Winter">Winter</option>
            </select>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <hr />  
        </td>
    </tr>
    <tr>
        <td>
            <label for="Benodigheden">Benodigheden:</label>
        </td>
        <td>
            <input type="text" id="Benodigheden"name="Benodigheden" placeholder="Benodigheden" required="required" />
        </td>
    </tr>
    <tr>
        <td>
            <label for="Opmerking">Opmerking:</label>
            </td>
        <td>
            <textarea name="Opmerking" id="Opmerking" cols="40" rows="5" placeholder="Opmerking" required="required" /></textarea>
            </td>
    </tr>
    <tr>
        <td>
        </td>
        <td>
            <div class="submit"><input type="submit" value="Verzenden" name="Verzenden" /></div>
        </td>
    </tr>
</table>

Here is a link to JSFiddle.

like image 389
William Avatar asked Feb 09 '23 12:02

William


1 Answers

While the above code is very good, minimal and clean, which is best. But IF you need different widths for each of your text inputs then inline CSS is needed.

Example code:

<input style="width: 300px;" type="text">
<input style="width: 340px;" type="text">
like image 198
toddgraves Avatar answered Feb 20 '23 13:02

toddgraves