skip to Main Content

See the problem here I have a container named "section-2" and I have used an image as a background on the right side of it, there is some extra part of that img that is out of the container and should be removed but I don’t know how to implement it. I would be grateful if you could suggest how to implement it.

I tried to give the image a specific height but it wasn’t something that I expected

2

Answers


  1. Try overflow: hidden; that should solve your problem.

    Login or Signup to reply.
  2. You can use overflow: hidden property to hide the excess image in the background respective to its parent div.

    .bg-img {
       overflow: hidden
    }
    

    Also if u just want to hide the part in single axis you can u overflow-x or overflow-y property

    for x axis:

    .bg-img {
       overflow-x: hidden
    }
    

    For y axis:

    .bg-img {
       overflow-: hidden
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search