I have a parent div and it has two child divs, the 1st child div contains an editor and 2nd child div contains a button. The parent div has position: relative;
and the 2nd child of it has position: absolute;
and its on the bottom right side. What I am experiencing is the button covers the content of 1st child div which I don't want. I want the editor div should cover all the space instead of the button. I used padding and margin on the button but it's not working, any suggestions?
One thing to mention is I can't use the button in 1st child div because it's a Vue component and just only gives me 1
<editor />
tag.
Try to add content to the 1st child div (the button will cover the content).
.parent {
background: lightgrey;
position: relative;
}
.child-1 {
border: 1px solid grey;
min-height: 50px;
height: auto;
}
.child-2 {
position: absolute;
bottom: 0;
right:0;
}
.editor-bar {
border: 1px solid;
}
.editor-bar th {
padding-left: 20px;
padding-right: 20px;
cursor: pointer;
}
.editor-bar th:hover {
background: grey;
}
.editor-body {
background: #eee;
}
button {
padding: 10px 15px;
background: lightgreen;
outline: none;
}
<div class="parent">
<div class="child-1">
<div class="editor">
<div class="editor-bar">
<table border="1">
<tr>
<th>B</th>
<th>I</th>
<th>U</th>
<th><del>S</del></th>
</tr>
</table>
</div>
<div class="editor-body" contenteditable="true" spellcheck="false">
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt aliquid sapiente eum reiciendis ipsam temporibus in, nihil tempora delectus? Quidem praesentium fugiat adipisci quos excepturi ducimus dolorem et doloribus cumque!
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt aliquid sapiente eum reiciendis ipsam temporibus in, nihil tempora delectus? Quidem praesentium fugiat adipisci quos excepturi ducimus dolorem et doloribus cumque!
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nesciunt aliquid sapiente eum reiciendis ipsam temporibus in. Nesciunt aliquid sapiente eum reiciendis ipsam.
</div>
</div>
</div>
<div class="child-2">
<button>Send</button>
</div>
</div>