Check out example codes for "css text to fit container". It will help you in understanding the concepts better.

Code Example 1

//The viewport-percentage lengths are relative to the size of the initial
//containing block. When the height or width of the initial containing block
//are changed, they are scaled accordingly.
//vw = (% of the viewport width). So using it will look like this:
p {
    font-size: 2.5vw;
}

Learn ReactJs, React Native from akashmittal.com