Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

textarea not filling div in css

I’m trying to fit the textarea "todo" in the div "box_3" but unfortunately it’s looking like in the picture and I’m not able to find the error. I assume it has to do with the size of box_3 and the display: grid but I can’t solve it.

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container_index {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 41vh 41vh;
}

.box_1 {
    background-color: blue;
    grid-column: 1 / 3;
    grid-row: 1 / 2;


}

.box_2 {
    background-color: green;
    grid-column: 1 / 3 ;
    grid-row: 2 / -2;


}

.box_3 {
    display: grid;
    grid-row: 3 / -3;
    grid-column: auto;
    background-color: white;
    place-content: start center;
    background-color: red;

}

.todo {
    width: 100%;
    height: 100%;
    resize: none;
    border: 2px solid blue;
}
<main>
    <div class="container_index">
        <div class="box_1"><h2>Test</h2></div>
        <div class="box_2"><h2>Test</h2></div>
        <div class="box_3">
            <textarea class="todo"></textarea>
        </div>
    </div>
</main>

This is how it looks

I tried to change the css multiple times without results

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You only need to remove display: grid; from the parent (.box_3)

Or just remove place-content: start center;

More info about place-content

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.container_index {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 41vh 41vh;
}

.box_1 {
    background-color: blue;
    grid-column: 1 / 3;
    grid-row: 1 / 2;


}

.box_2 {
    background-color: green;
    grid-column: 1 / 3 ;
    grid-row: 2 / -2;


}

.box_3 {
    grid-row: 3 / -3;
    grid-column: auto;
    background-color: white;
    place-content: start center;
    background-color: red;

}

.todo {
    width: 100%;
    height: 100%;
    resize: none;
    border: 2px solid blue;
}
<main>
    <div class="container_index">
        <div class="box_1"><h2>Test</h2></div>
        <div class="box_2"><h2>Test</h2></div>
        <div class="box_3">
            <textarea class="todo"></textarea>
        </div>
    </div>
</main>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading