I have a div that contains two elements. An Icon <i> and a textarea <textarea>.
I know exactly how I want this to look and did a quick mock up with the dimensions figured out.
In case my mock up is too sloppy the layout is this.
The div .container has a width of 220px and a height of 35px width: 220px height:35px.
The two elements in the div are to be 4px apart and 4px from the border of the div. (Which I did with padding)
The icon .fa-plus-square has a height and width of 27px font-size: 27px. (I assumed this sets the width and height to be the same size, but I am unsure. This may be what is causing the problem)
The textarea .input has a width of 181px and a height of 27px width: 181px height: 27px.
Whats actually happening I have colored the add div blue to show you what the elements should be contained in.
Html Code
<div class="add">
<i class="far fa-plus-square" type="submit"></i>
<textarea class="input" placeholder="Add to To-Do list"></textarea>
</div>
Css
.add {
background-color: blue;
width: 220px;
height: 35px;
}
.fa-plus-square {
font-size: 27px;
padding-left: 4px;
padding-top: 4px;
padding-bottom: 4px;
color: rgb(254, 217, 67);
}
.input {
padding-left: 4px;
padding-top: 4px;
padding-bottom: 4px;
resize: none;
width: 181px;
height: 27px;
outline: none;
}
Let me know if more information is needed.
