skip to Main Content

My entire webpage is too wide, for context, im trying to make a webpage that has a form on one side, and an image on the other and it has to be under two divs.

I have tried my best so far to find a solution but I keep getting stumped.
I tried the flex thing, I have tried putting a parent div, but nothing seemed to work, until it did however after getting it to work, my form and div were too wide I have to scroll to the side to get it visible which Is something I do not want.

2

Answers


  1. I don’t know if this will work for you, based on your explanation, I wanted to give you a possible solution.

    • First take a parent div, make it’s size, 100vh in height and 100vw in width, also make the overflow-x and y hidden. It will make your parent div to take the entire view box of the screen, and also disables scrolling.

    • Take a children div, this is where you will pull everything you want. Just make the children div, overflow-y-scroll, it will allow you to scroll inside your children div. Depending if you want to scroll in x axis to you can make it overflow-x-scroll as well.

    For better visualization, just color the divs, that will give you a general idea.

    Login or Signup to reply.
  2. You can try and add a width to the form and image paired with a parent div

    #parent {
        width: 100%;
    }
    #form {
        width: 50%;
        float: left;
    }
    #image {
        width: 50%;
        float: left;
    }
    

    That or you can put the form and image both in separate child divs with their widths set to 50% and the image and form to 100% inside them

    #formdiv {
        width: 50%;
        float: left;
    }
    #imagediv {
        width: 50%;
        float: left;
    }
    #form { width: 100%; }
    #image { width: 100%; }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search