I am trying to make notes webpage like google keep.I tried setting height to auto but it still doesn’t works
i want the div container to expand height with the increase in the content.this is the result when i set height to auto
i want to get result like this
.note {
position: relative;
display: inline-block;
background: #82589F;
border-radius: 7px;
padding: 10px;
width: 300px;
height: auto;
overflow: visible;
height: fit-content;
margin: 16px;
top: 2rem;
left: 2rem;
}
.note h1 {
font-size: 1.1em;
margin-bottom: 6px;
}
.note p {
position: absolute;
top: 3rem;
font-size: 20px;
white-space: pre-wrap;
word-wrap: break-word;
color: #A3A3A3;
}
.note button {
position: absolute;
border: none;
height: 0px;
bottom: 1rem;
right: 0;
cursor: pointer;
outline: none;
}
2
Answers
You just need to remove the height property
Read more about the height property Here
I did a litle example