InsideDarkWeb.com

Fit container inside image

There’s a way to auto fit my div inside my image without use of % in my css? I can fit it using % , but I can’t get responsive . PS : I want to add an scroll inside my div, that my text fit inside my screen and I can scroll it inside

where my screen is an IMG and my text inside my div

.Screen{
    position: absolute;
    top: 20%;
    right: 10%;
    width: 80%;    
    z-index: 1;
}

.text{
    position: absolute;
    top: 23%;
    right: 14%;

    overflow: auto;
    
    width: 73%;
    height: 35%;
    
}

Stack Overflow Asked on November 15, 2021

1 Answers

One Answer

.Screen{
    position: relative;
    top: 20%;
    right: 10%;    
}

.text{
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    bottom: 10px;
    overflow-y: scroll;
}

You can use this. As there were no image in the post you have to adjust the values accordingly. Let me know if you stuck anywhere! Happy coding!

Answered by Mithun Das on November 15, 2021

Add your own answers!

Related Questions

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.