Search code examples
reactjsbackground-color

why is background color only applied to the visible part


I learn Reactjs and Javascript and cant figure out why my style is not used all the way down.

This is the render

return (
        <div className="pg-viewer-wrapper">
            <div
                className="pg-viewer"
                id="pg-viewer"
                style={{
                    backgroundColor: 'white',
                }}
            >
                <TextViewer fileType="txt" filePath={theFile} />
            </div>
        </div>
)

Here's a picture of what it looks like:

enter image description here

When I scroll down it looks like this:

enter image description here

The white color is not applied all the way down!
I know this is an easy fix probably but I'm new and have search for an answer! Please advice


Solution

  • You set background color only for div which contain TextViewer. You need to set background color for TextViewer.