Home > Mobile >  Input element not working with flex property
Input element not working with flex property

Time:01-09

for some reason <input type="text"/> wont work with flex: 1;

using svelte btw but I dont think it matters

<main>
    <section>
        <span>Name:</span>
        <input type="text" bind:value={...} />
        <span>Age:</span>
        <input type="text" bind:value={...} />
    </section>
</main>

<style>
    main {
        width: 50vw;
        padding: 1rem;
    }

    section {
        display: flex;
        gap: 1rem;
    }

    input {
        flex: 1; /* doesnt work            
  • Related