Check out example codes for "make div the size of the text inside". It will help you in understanding the concepts better.

Code Example 1

div {
display: inline-block;
}

Learn ReactJs, React Native from akashmittal.com