Krissu3212 Posted June 17, 2020 Share Posted June 17, 2020 Hi, why does these div tags stretch their margins across the whole "main" div. The "main" div is inside "maincontainer" div that covers the whole page basically and the "main" div is 90% of it. I don't want these margins because i want the pictures to be next to each other. Here's also the CSS of those divs: (I'm sure there's a way to not repeat all this code but I needed to have them in different divs to position them differently on the website, which i haven't done yet) #main { height: 100%; width: 90%; margin-left: 91px; } /* Main div is inside it */ #maincontainer { /* Sets two background images */ width: 100%; height: 2415px; background-image: url("images/city.jpg"), url("images/nature.jpg"); background-position: top, bottom; background-size: 100% 50%; background-repeat: no-repeat, no-repeat; } .button_container1 { height: 180px; width: 200px; margin-top: 20px; border: 2px solid black; background-color: white; border-radius: 6px; /* margin-left: 972px; */ } .button_container2 { height: 180px; width: 200px; margin-top: 20px; border: 2px solid black; background-color: white; border-radius: 6px; margin: 0; } .button_container3 { height: 180px; width: 200px; margin-top: 20px; border: 2px solid black; background-color: white; border-radius: 6px; margin: 0; } 2020-06-17 13-13-16.mp4 Link to comment Share on other sites More sharing options...
ishan_shah Posted July 13, 2020 Share Posted July 13, 2020 You can use bootstrap container like <div class="row"> <div class="col-3"> your contain </div> </div> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now